[firebase][remoteconfig] Added Remote Config component

- Added docs
- Added binding
- Added sample
- Added nuget file
- Added icons
This commit is contained in:
SotoiGhost 2016-10-11 13:50:05 -05:00
Родитель 587f6172d7
Коммит 0eda454810
32 изменённых файлов: 1373 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,46 @@
#load "../common.cake"
var TARGET = Argument ("t", Argument ("target", "Default"));
buildSpec = new BuildSpec () {
Libs = new ISolutionBuilder [] {
new DefaultSolutionBuilder {
SolutionPath = "source/Firebase.RemoteConfig.sln",
BuildsOn = BuildPlatforms.Mac,
OutputFiles = new [] {
new OutputFileCopy {
FromFile = "./source/Firebase.RemoteConfig/bin/Release/Firebase.RemoteConfig.dll",
},
}
}
},
Samples = new ISolutionBuilder [] {
new IOSSolutionBuilder { SolutionPath = "./samples/RemoteConfigSample/RemoteConfigSample.sln", BuildsOn = BuildPlatforms.Mac },
},
NuGets = new [] {
new NuGetInfo { NuSpec = "./nuget/Xamarin.FIrebase.iOS.RemoteConfig.nuspec", BuildsOn = BuildPlatforms.Mac},
},
Components = new [] {
new Component {ManifestDirectory = "./component", BuildsOn = BuildPlatforms.Mac},
},
};
// "Firebase.InstanceID" implied from Firebase.Analytics
MyDependencies = new [] {"Firebase.Analytics"};
Task ("clean").IsDependentOn ("clean-base").Does (() =>
{
InvokeOtherGoogleModules (MyDependencies, "clean");
RunMake ("./externals/", "clean");
DeleteFiles ("../tmp-nugets/Xamarin.Firebase.iOS.RemoteConfig*");
});
SetupXamarinBuildTasks (buildSpec, Tasks, Task);
RunTarget (TARGET);

Просмотреть файл

@ -0,0 +1,19 @@
Change the behavior and appearance of your app without publishing an app update.
Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your app without requiring users to download an app update. When using Remote Config, you create in-app default values that control the behavior and appearance of your app. Then, you can later use the Firebase console to override in-app default values for all app users or for segments of your userbase. Your app controls when updates are applied, and it can frequently check for updates and apply them with a negligible impact on performance.
## Key capabilities
* **Quickly roll out changes to your app's userbase:** You can make changes to your app's default behavior and appearance by changing server-side parameter values. For example, you could change your app's layout or color theme to support a seasonal promotion, with no need to publish an app update.
* **Customize your app for segments of your userbase:** You can use Remote Config to provide variations on your app's user experience to different segments of your userbase by app version, by Firebase Analytics audience, by language, and more.
* **Run A/B tests to improve your app:** You can use Remote Config random percentile targeting with Firebase Analytics to A/B test improvements to your app across different segments of your userbase so that you can validate improvements before rolling them out to your entire userbase.
## How does it work?
Remote Config includes a client library that handles important tasks like fetching parameter values and caching them, while still giving you control over when new values are activated so that they affect your app's user experience. This lets you safeguard your app experience by controlling the timing of any changes.
The Remote Config client library get methods provide a single access point for parameter values. Your app gets server-side values using the same logic it uses to get in-app default values, so you can add the capabilities of Remote Config to your app without writing a lot of code.
To override in-app default values, you use the Firebase console to create parameters with the same names as the parameters used in your app. For each parameter, you can set a server-side default value to override the in-app default value, and you can also create conditional values to override the in-app default value for app instances that meet certain conditions.
<sub>_Portions of this page are modifications based on work created and [shared by Google](https://developers.google.com/readme/policies/) and used according to terms described in the [Creative Commons 3.0 Attribution License](http://creativecommons.org/licenses/by/3.0/). Click [here](https://firebase.google.com/docs/remote-config/) to see original Firebase documentation._</sub>

Просмотреть файл

@ -0,0 +1,139 @@
# Use Firebase Remote Config on iOS
You can use Firebase Remote Config to define parameters in your app and update their values in the cloud, allowing you to modify the appearance and behavior of your app without distributing an app update.
## Add Firebase to your app
1. Create a Firebase project in the [Firebase console][1], if you don't already have one. If you already have an existing Google project associated with your mobile app, click **Import Google Project**. Otherwise, click **Create New Project**.
2. Click **Add Firebase to your iOS app** and follow the setup steps. If you're importing an existing Google project, this may happen automatically and you can just [download the config file][2].
3. When prompted, enter your app's bundle ID. It's important to enter the bundle ID your app is using; this can only be set when you add an app to your Firebase project.
4. At the end, you'll download a `GoogleService-Info.plist` file. You can [download this file][2] again at any time.
## Configure Remote Config in your app
Once you have your `GoogleService-Info.plist` file downloaded in your computer, do the following steps in Xamarin Studio:
1. Add `GoogleService-Info.plist` file to your app project.
2. Set `GoogleService-Info.plist` **build action** behaviour to `Bundle Resource` by Right clicking/Build Action.
3. Add the following line of code somewhere in your app, typically in your AppDelegate's `FinishedLaunching` method (don't forget to import `Firebase.Analytics` namespace):
```csharp
App.Configure ();
```
## Add Settings to Remote Config class
Create settings for `RemoteConfig` class, you can enable developer mode to allow for frequent refreshes of the cache (don't forget to import `Firebase.RemoteConfig` namespace):
```csharp
// Enabling developer mode, allows for frequent refreshes of the cache
RemoteConfig.SharedInstance.ConfigSettings = new RemoteConfigSettings (true);
```
## Set in-app default parameter values
You can set in-app default parameter values in the Remote Config object, so that your app behaves as intended before it connects to the Remote Config Server, and so that default values are available if none are set on the server. You can achieve this with a **.plist** file or with an **NSDictionary** variable.
### Set in-app default parameter values with .plist file
In your Xamarin Studio app project do the following steps to add default parameters with .plist file:
1. In your project app name do Right click/Add/New File...
2. In **New File** dialog, select iOS tab and choose Property List
3. Name the Property List as you want and click **New**
4. Change the **Build ACtion** of your just created file to **BundleResource** by Right clicking it/Build Action
5. Open your **.plist** file and add all the parameters that you want.
After you have setup all your default parameters, set the **.plist** to the `RemoteConfig` class:
```csharp
RemoteConfig.SharedInstance.SetDefaults ("<Your plist name here>");
```
### Set in-app default parameter values with a NSDictionary
Instead of using a **.plist file** to load default parameter values to your app, you can create a `NSDictionary` to load them:
```csharp
object [] values = { 5, 20 };
object [] keys = { "times_table", "from_zero_to" };
var defaultValues = NSDictionary.FromObjectsAndKeys (values, keys, keys.Length);
RemoteConfig.SharedInstance.SetDefaults (defaultValues);
```
## Set parameter values in Firebase Console
1. In the [Firebase console][1], open your project.
2. Select **Remote Config** from the menu to view the Remote Config dashboard.
3. Define parameters with the same names as the parameters that you defined in your **.plist** file or in your **NSDictionary**. For each parameter, you can set a default value (which will eventually override the in-app default value) and you can also set conditional values. To learn more, see [Remote Config Parameters and Conditions][3].
## Fetch and activate values from the server
After you have setup your parameter values in your app and in your server, you are ready to fetch those values in your app from the server so you can override your local values. Call `RemoteConfig.Fetch` instance method to retrieve values from server and call `RemoteConfig.ActivateFetched` instance method to make fetched parameter values available to your app:
```csharp
// CacheExpirationSeconds is set to CacheExpiration here, indicating that any previously
// fetched and cached config would be considered expired because it would have been fetched
// more than CacheExpiration seconds ago. Thus the next fetch would go to the server unless
// throttling is in progress. The default expiration duration is 43200 (12 hours).
RemoteConfig.SharedInstance.Fetch (10, (status, error) => {
switch (status) {
case RemoteConfigFetchStatus.Success:
Console.WriteLine ("Config Fetched!");
// Call this method to make fetched parameter values available to your app
RemoteConfig.SharedInstance.ActivateFetched ();
// Update your UI from here
...
break;
case RemoteConfigFetchStatus.Throttled:
case RemoteConfigFetchStatus.NoFetchYet:
case RemoteConfigFetchStatus.Failure:
Console.WriteLine ("Config not fetched...");
break;
}
});
```
## Use parameter values
The way you can use parameter values in your app is by calling `RemoteConfig.GetConfigValue` instance method or using `RemoteConfig` indexer method:
```csharp
var myValue = RemoteConfig.SharedInstance ["myKey"].NumberValue;
var myOtherValue = RemoteConfig.SharedInstance.GetConfigValue ("myOtherKey").StringValue;
```
## Caching and throttling
Remote Config caches values locally after the first successful request. By default the cache expires after 12 hours, but you can change the cache expiration for a specific request by passing the desired cache expiration, in seconds, to `Fetch` method. If the values in the cache are older than the desired cache expiration, Remote Config will request fresh config values from the server. If your app requests fresh values using `Fetch` several times, requests are throttled and your app is provided with a cached value.
During app development, you might want to refresh the cache very frequently (many times per hour) to let you rapidly iterate as you develop and test your app. To accommodate rapid iteration on a project with up to 10 developers, you can temporarily add a `RemoteConfigSettings` property with `IsDeveloperModeEnabled` set to true to your app, changing the caching settings of the `RemoteConfig` object.
### Known issues
* App doesn't compile when `Incremental builds` is enabled. (Bug [#43689][9])
<sub>_Portions of this page are modifications based on work created and [shared by Google](https://developers.google.com/readme/policies/) and used according to terms described in the [Creative Commons 3.0 Attribution License](http://creativecommons.org/licenses/by/3.0/). Click [here](https://firebase.google.com/docs/remote-config/use-config-ios) to see original Firebase documentation._</sub>
[1]: https://firebase.google.com/console/
[2]: http://support.google.com/firebase/answer/7015592
[3]: https://firebase.google.com/docs/remote-config/parameters
[9]: https://bugzilla.xamarin.com/show_bug.cgi?id=43689
[1]: https://firebase.google.com/console/
[2]: http://support.google.com/firebase/answer/7015592
[3]: https://firebase.google.com/docs/cloud-messaging/ios/certs
[4]: https://firebase.google.com/docs/cloud-messaging/ios/client#upload_your_apns_certificate
[5]: https://firebase.google.com/docs/cloud-messaging/ios/client#register_for_remote_notifications
[6]: https://firebase.google.com/docs/cloud-messaging/http-server-ref#notification-payload-support
[7]: https://firebase.google.com/docs/cloud-messaging/ios/topic-messaging#build_send_requests
[8]: https://firebase.google.com/docs/cloud-messaging/ios/device-group
[9]: https://bugzilla.xamarin.com/show_bug.cgi?id=43689

Просмотреть файл

@ -0,0 +1,17 @@
**Xamarin is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may require or install dependencies which are governed by additional licenses.**
Note: This component depends on [Firebase Remote Config for iOS](https://firebase.google.com/docs/remote-config/use-config-ios), which is subject to the [Terms of Service for Firebase Services](https://firebase.google.com/terms/).
### Xamarin Component for Firebase Remote Config for iOS
**The MIT License (MIT)**
Copyright (c) .NET Foundation Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20160910

Просмотреть файл

@ -0,0 +1,39 @@
version: 1.3.0.0
name: Firebase Remote Config for iOS
id: firebaseiosremoteconfig
publisher: Xamarin Inc.
publisher-url: http://xamarin.com
src-url: https://github.com/xamarin/GoogleApisForiOSComponents/tree/master/Firebase.RemoteConfig
summary: Firebase Remote Config is a cloud service that lets you change the appearance and behavior of your app without requiring users to download an app update.
icons:
- ../../icons/firebaseiosremoteconfig_128x128.png
- ../../icons/firebaseiosremoteconfig_512x512.png
docs-url: https://firebase.google.com/docs/cloud-messaging/
libraries:
ios-unified:
- ../output/Firebase.RemoteConfig.dll
- ../../Firebase.Analytics/output/Firebase.Analytics.dll
- ../../Firebase.InstanceID/output/Firebase.InstanceID.dll
is_shell: true
packages:
ios-unified:
- Xamarin.Firebase.iOS.RemoteConfig, Version=1.3.0.0
- Xamarin.Firebase.iOS.Analytics, Version=3.4.2.0
- Xamarin.Firebase.iOS.InstanceID, Version=1.0.8.0
samples:
- name: "Remote Config Sample"
path: ../samples/RemoteConfigSample/RemoteConfigSample.sln
removeProjects:
- Firebase.RemoteConfig
- Firebase.Analytics
- Firebase.InstanceID
installNuGets:
- project: RemoteConfigSample
packages:
- Xamarin.Firebase.iOS.RemoteConfig
removeNodes:
- "//xNS:Import[contains (@Project, 'Firebase.RemoteConfig.targets')]"
- "//xNS:Import[contains (@Project, 'Firebase.Analytics.targets')]"
- "//xNS:Import[contains (@Project, 'Firebase.InstanceID.targets')]"
local-nuget-repo: ../../tmp-nugets
no_build: true

14
Firebase.RemoteConfig/externals/Makefile поставляемый Normal file
Просмотреть файл

@ -0,0 +1,14 @@
POD=pod
all: Podfile.lock
Podfile.lock :
$(POD) install
clean:
rm -rf Podfile.lock Pods
.PHONY: all clean

36
Firebase.RemoteConfig/externals/Podfile поставляемый Normal file
Просмотреть файл

@ -0,0 +1,36 @@
=begin
Last run FirebaseRemoteConfig installed:
- FirebaseAnalytics (3.4.2)
- FirebaseInstanceID (1.0.8)
- FirebaseRemoteConfig (1.3.0)
- GoogleIPhoneUtilities (1.2.1)
- GoogleInterchangeUtilities (1.2.1)
- GoogleSymbolUtilities (1.1.1)
- GoogleUtilities (1.3.1)
Check if main version or subversion number has changed.
If yes, please, update *.targets files located in binding
projects, also, update Podfile files if needed.
In .targets file, located in Firebase.RemoteConfig binding, you can find:
- FirebaseRemoteConfig (1.3.0)
- GoogleIPhoneUtilities (1.2.1)
In .targets file, located in Firebase.Analytics binding, you can find:
- FirebaseAnalytics (3.4.2)
- GoogleInterchangeUtilities (1.2.1)
- GoogleSymbolUtilities (1.1.1)
- GoogleUtilities (1.3.1)
In .targets file, located in Firebase.InstanceID binding, you can find:
- FirebaseInstanceID (1.0.8)
=end
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
install! 'cocoapods', :integrate_targets => false
target 'FirebaseRemoteConfig' do
pod 'FirebaseRemoteConfig', '1.3.0'
end

Просмотреть файл

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>Xamarin.Firebase.iOS.RemoteConfig</id>
<title>Firebase APIs Remote Config iOS Library</title>
<version>1.3.0.0</version>
<authors>Xamarin Inc.</authors>
<owners>Xamarin Inc.</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>C# bindings for Firebase APIs Remote Config iOS Library</description>
<copyright>Copyright 2016 Microsoft</copyright>
<projectUrl>https://components.xamarin.com/view/firebaseiosremoteconfig</projectUrl>
<licenseUrl>https://components.xamarin.com/license/firebaseiosremoteconfig</licenseUrl>
<iconUrl>https://raw.githubusercontent.com/xamarin/GoogleApisForiOSComponents/master/icons/firebaseiosremoteconfig_128x128.png</iconUrl>
<dependencies>
<dependency id="Xamarin.Build.Download" version="0.2.2"/>
<dependency id="Xamarin.Firebase.iOS.Analytics" version="3.4.2.0"/>
<dependency id="Xamarin.Firebase.iOS.InstanceID" version="1.0.8.0"/>
</dependencies>
</metadata>
<files>
<file src="output/Firebase.RemoteConfig.dll" target="lib/Xamarin.iOS10" />
<!-- Add targets file for external native reference download -->
<file src="source/Firebase.RemoteConfig/Firebase.RemoteConfig.targets" target="build/Xamarin.Firebase.iOS.RemoteConfig.targets" />
</files>
</package>

Просмотреть файл

@ -0,0 +1,53 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoteConfigSample", "RemoteConfigSample\RemoteConfigSample.csproj", "{F26D64FB-D6A2-41E2-9B31-E8DA0AA400C8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Firebase.InstanceID", "..\..\..\Firebase.InstanceID\source\Firebase.InstanceID\Firebase.InstanceID.csproj", "{D6AA184C-DA45-4BBB-988A-451B20C7B804}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Firebase.Analytics", "..\..\..\Firebase.Analytics\source\Firebase.Analytics\Firebase.Analytics.csproj", "{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Firebase.RemoteConfig", "..\..\source\Firebase.RemoteConfig\Firebase.RemoteConfig.csproj", "{C5B2256A-D3E4-4419-9486-1020885EE738}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhone = Release|iPhone
Release|iPhoneSimulator = Release|iPhoneSimulator
Debug|iPhone = Debug|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F26D64FB-D6A2-41E2-9B31-E8DA0AA400C8}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{F26D64FB-D6A2-41E2-9B31-E8DA0AA400C8}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{F26D64FB-D6A2-41E2-9B31-E8DA0AA400C8}.Release|iPhone.ActiveCfg = Release|iPhone
{F26D64FB-D6A2-41E2-9B31-E8DA0AA400C8}.Release|iPhone.Build.0 = Release|iPhone
{F26D64FB-D6A2-41E2-9B31-E8DA0AA400C8}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{F26D64FB-D6A2-41E2-9B31-E8DA0AA400C8}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{F26D64FB-D6A2-41E2-9B31-E8DA0AA400C8}.Debug|iPhone.ActiveCfg = Debug|iPhone
{F26D64FB-D6A2-41E2-9B31-E8DA0AA400C8}.Debug|iPhone.Build.0 = Debug|iPhone
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Release|iPhone.ActiveCfg = Release|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Release|iPhone.Build.0 = Release|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Debug|iPhone.Build.0 = Debug|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Release|iPhone.ActiveCfg = Release|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Release|iPhone.Build.0 = Release|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Debug|iPhone.Build.0 = Debug|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Release|iPhone.ActiveCfg = Release|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Release|iPhone.Build.0 = Release|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Debug|iPhone.Build.0 = Debug|Any CPU
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,66 @@
using System;
using Foundation;
using UIKit;
using Firebase.Analytics;
using Firebase.RemoteConfig;
namespace RemoteConfigSample
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
[Register ("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
// class-level declarations
public override UIWindow Window {
get;
set;
}
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
// If not required for your application you can safely delete this method
// Use Firebase library to configure APIs
App.Configure ();
// Enabling developer mode, allows for frequent refreshes of the cache
RemoteConfig.SharedInstance.ConfigSettings = new RemoteConfigSettings (true);
// You can set default parameter values using an NSDictionary object or a plist file.
var defaultPlist = NSBundle.MainBundle.PathForResource ("RemoteConfigDefaults", "plist");
if (defaultPlist != null) {
RemoteConfig.SharedInstance.SetDefaults ("RemoteConfigDefaults");
} else {
object [] values = { 5, 20 };
object [] keys = { "times_table", "from_zero_to" };
var defaultValues = NSDictionary.FromObjectsAndKeys (values, keys, keys.Length);
RemoteConfig.SharedInstance.SetDefaults (defaultValues);
}
(Window.RootViewController as UINavigationController).PushViewController (new RemoteConfigViewController (), true);
return true;
}
public static void ShowMessage (string title, string message, UIViewController fromViewController, Action actionForOk = null)
{
if (UIDevice.CurrentDevice.CheckSystemVersion (8, 0)) {
var alert = UIAlertController.Create (title, message, UIAlertControllerStyle.Alert);
alert.AddAction (UIAlertAction.Create ("Ok", UIAlertActionStyle.Default, (obj) => {
if (actionForOk != null) {
actionForOk ();
}
}));
fromViewController.PresentViewController (alert, true, null);
} else {
new UIAlertView (title, message, null, "Ok", null).Show ();
}
}
}
}

Просмотреть файл

@ -0,0 +1,157 @@
{
"images": [
{
"idiom": "iphone",
"size": "29x29",
"scale": "1x"
},
{
"idiom": "iphone",
"size": "29x29",
"scale": "2x"
},
{
"idiom": "iphone",
"size": "29x29",
"scale": "3x"
},
{
"idiom": "iphone",
"size": "40x40",
"scale": "2x"
},
{
"idiom": "iphone",
"size": "40x40",
"scale": "3x"
},
{
"idiom": "iphone",
"size": "57x57",
"scale": "1x"
},
{
"idiom": "iphone",
"size": "57x57",
"scale": "2x"
},
{
"idiom": "iphone",
"size": "60x60",
"scale": "2x"
},
{
"idiom": "iphone",
"size": "60x60",
"scale": "3x"
},
{
"idiom": "ipad",
"size": "29x29",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "29x29",
"scale": "2x"
},
{
"idiom": "ipad",
"size": "40x40",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "40x40",
"scale": "2x"
},
{
"idiom": "ipad",
"size": "50x50",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "50x50",
"scale": "2x"
},
{
"idiom": "ipad",
"size": "72x72",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "72x72",
"scale": "2x"
},
{
"idiom": "ipad",
"size": "76x76",
"scale": "1x"
},
{
"idiom": "ipad",
"size": "76x76",
"scale": "2x"
},
{
"size": "24x24",
"idiom": "watch",
"scale": "2x",
"role": "notificationCenter",
"subtype": "38mm"
},
{
"size": "27.5x27.5",
"idiom": "watch",
"scale": "2x",
"role": "notificationCenter",
"subtype": "42mm"
},
{
"size": "29x29",
"idiom": "watch",
"role": "companionSettings",
"scale": "2x"
},
{
"size": "29x29",
"idiom": "watch",
"role": "companionSettings",
"scale": "3x"
},
{
"size": "40x40",
"idiom": "watch",
"scale": "2x",
"role": "appLauncher",
"subtype": "38mm"
},
{
"size": "44x44",
"idiom": "watch",
"scale": "2x",
"role": "longLook",
"subtype": "42mm"
},
{
"size": "86x86",
"idiom": "watch",
"scale": "2x",
"role": "quickLook",
"subtype": "38mm"
},
{
"size": "98x98",
"idiom": "watch",
"scale": "2x",
"role": "quickLook",
"subtype": "42mm"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
<string>ca-app-pub-3940256099942544/2934735716</string>
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
<string>ca-app-pub-3940256099942544/4411468910</string>
<key>CLIENT_ID</key>
<string>542613023302-70fn087heqjim1cid4c6f5bih9vb90jl.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.542613023302-70fn087heqjim1cid4c6f5bih9vb90jl</string>
<key>API_KEY</key>
<string>AIzaSyD36zdfPJDkRValUgcv2JKxM0TShl6a1go</string>
<key>GCM_SENDER_ID</key>
<string>542613023302</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.xamarin.firebase.ios.remoteconfigsample</string>
<key>PROJECT_ID</key>
<string>xamarinfirebase-67094</string>
<key>STORAGE_BUCKET</key>
<string>xamarinfirebase-67094.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false/>
<key>IS_ANALYTICS_ENABLED</key>
<false/>
<key>IS_APPINVITE_ENABLED</key>
<false/>
<key>IS_GCM_ENABLED</key>
<false/>
<key>IS_SIGNIN_ENABLED</key>
<false/>
<key>GOOGLE_APP_ID</key>
<string>1:542613023302:ios:dedc980a207dbd7d</string>
<key>DATABASE_URL</key>
<string>https://xamarinfirebase-67094.firebaseio.com</string>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>RemoteConfigSample</string>
<key>CFBundleIdentifier</key>
<string>com.xamarin.firebase.ios.remoteconfigsample</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>7.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS" />
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530" />
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb" />
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok" />
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600" />
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" />
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" />
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder" />
</objects>
<point key="canvasLocation" x="53" y="375" />
</scene>
</scenes>
</document>

Просмотреть файл

@ -0,0 +1,15 @@
using UIKit;
namespace RemoteConfigSample
{
public class Application
{
// This is the main entry point of the application.
static void Main (string [] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="JnU-lz-osk">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
<scene sceneID="RNW-Ou-Wi6">
<objects>
<navigationController id="JnU-lz-osk" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="GLn-QE-1Id">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" red="0.0" green="0.52156862749999999" blue="0.8862745098" alpha="1" colorSpace="calibratedRGB"/>
<textAttributes key="titleTextAttributes">
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</textAttributes>
</navigationBar>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Sbw-4d-rUu" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-769" y="139"/>
</scene>
</scenes>
</document>

Просмотреть файл

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>times_table</key>
<integer>5</integer>
<key>from_zero_to</key>
<integer>20</integer>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Build.Download.0.2.2\build\Xamarin.Build.Download.props" Condition="Exists('..\packages\Xamarin.Build.Download.0.2.2\build\Xamarin.Build.Download.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProjectGuid>{F26D64FB-D6A2-41E2-9B31-E8DA0AA400C8}</ProjectGuid>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>RemoteConfigSample</RootNamespace>
<AssemblyName>RemoteConfigSample</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<MtouchFastDev>true</MtouchFastDev>
<MtouchProfiling>true</MtouchProfiling>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchLink>None</MtouchLink>
<MtouchArch>i386</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<MtouchTlsProvider>Default</MtouchTlsProvider>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<MtouchTlsProvider>Default</MtouchTlsProvider>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchLink>None</MtouchLink>
<MtouchArch>i386</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<MtouchTlsProvider>Default</MtouchTlsProvider>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<DeviceSpecificBuild>true</DeviceSpecificBuild>
<MtouchDebug>true</MtouchDebug>
<MtouchFastDev>false</MtouchFastDev>
<MtouchProfiling>true</MtouchProfiling>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<MtouchTlsProvider>Default</MtouchTlsProvider>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
<Reference Include="MonoTouch.Dialog-1" />
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" />
<ImageAsset Include="Assets.xcassets\Contents.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="LaunchScreen.storyboard" />
<InterfaceDefinition Include="Main.storyboard" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="RemoteConfigViewController.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Firebase.Analytics\source\Firebase.Analytics\Firebase.Analytics.csproj">
<Project>{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}</Project>
<Name>Firebase.Analytics</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Firebase.InstanceID\source\Firebase.InstanceID\Firebase.InstanceID.csproj">
<Project>{D6AA184C-DA45-4BBB-988A-451B20C7B804}</Project>
<Name>Firebase.InstanceID</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\source\Firebase.RemoteConfig\Firebase.RemoteConfig.csproj">
<Project>{C5B2256A-D3E4-4419-9486-1020885EE738}</Project>
<Name>Firebase.RemoteConfig</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BundleResource Include="GoogleService-Info.plist" />
<BundleResource Include="RemoteConfigDefaults.plist" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)..\..\..\..\Firebase.InstanceID\source\Firebase.InstanceID\Firebase.InstanceID.targets" />
<Import Project="$(MSBuildThisFileDirectory)..\..\..\..\Firebase.Analytics\source\Firebase.Analytics\Firebase.Analytics.targets" />
<Import Project="$(MSBuildThisFileDirectory)..\..\..\source\Firebase.RemoteConfig\Firebase.RemoteConfig.targets" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<Import Project="..\packages\Xamarin.Build.Download.0.2.2\build\Xamarin.Build.Download.targets" Condition="Exists('..\packages\Xamarin.Build.Download.0.2.2\build\Xamarin.Build.Download.targets')" />
</Project>

Просмотреть файл

@ -0,0 +1,75 @@
using System;
using MonoTouch.Dialog;
using UIKit;
using Firebase.RemoteConfig;
namespace RemoteConfigSample
{
public class RemoteConfigViewController : DialogViewController
{
public RemoteConfigViewController () : base (UITableViewStyle.Grouped, null, true)
{
Root = new RootElement ("Firebase Remote Config");
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
var btnFetch = new UIBarButtonItem ("Fetch", UIBarButtonItemStyle.Plain, FetchFromServer);
btnFetch.TintColor = UIColor.White;
NavigationItem.RightBarButtonItem = btnFetch;
GenerateTimesTable ();
}
void GenerateTimesTable ()
{
Root.Clear ();
// Get values from defaults or from values fetched from server
var timesTable = RemoteConfig.SharedInstance ["times_table"].NumberValue.Int16Value;
var timesTableLength = RemoteConfig.SharedInstance ["from_zero_to"].NumberValue.Int16Value;
if (timesTable < 0 || timesTableLength < 0) {
AppDelegate.ShowMessage ("Negative numbers!", "Times table or the length of table is a negative number.", NavigationController, null);
return;
}
var timesSection = new Section ($"{timesTable} times table");
for (int i = 0; i <= timesTableLength; i++)
timesSection.Add (new StringElement ($"{timesTable} x {i} = {timesTable * i}"));
Root.Add (timesSection);
}
void FetchFromServer (object sender, EventArgs e)
{
// CacheExpirationSeconds is set to CacheExpiration here, indicating that any previously
// fetched and cached config would be considered expired because it would have been fetched
// more than CacheExpiration seconds ago. Thus the next fetch would go to the server unless
// throttling is in progress. The default expiration duration is 43200 (12 hours).
RemoteConfig.SharedInstance.Fetch (10, (status, error) => {
switch (status) {
case RemoteConfigFetchStatus.Success:
AppDelegate.ShowMessage ("Config Fetched!", "The table will be updated", NavigationController, () => {
RemoteConfig.SharedInstance.ActivateFetched ();
// Now that the values have been updated, you can generate the times table again
GenerateTimesTable ();
});
break;
case RemoteConfigFetchStatus.Throttled:
case RemoteConfigFetchStatus.NoFetchYet:
case RemoteConfigFetchStatus.Failure:
AppDelegate.ShowMessage ("Config not fetched...", error.LocalizedDescription, NavigationController, null);
break;
}
});
}
}
}

Просмотреть файл

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Build.Download" version="0.2.2" targetFramework="xamarinios10" />
</packages>

Просмотреть файл

@ -0,0 +1,29 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Firebase.RemoteConfig", "Firebase.RemoteConfig\Firebase.RemoteConfig.csproj", "{C5B2256A-D3E4-4419-9486-1020885EE738}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Firebase.InstanceID", "..\..\Firebase.InstanceID\source\Firebase.InstanceID\Firebase.InstanceID.csproj", "{D6AA184C-DA45-4BBB-988A-451B20C7B804}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Firebase.Analytics", "..\..\Firebase.Analytics\source\Firebase.Analytics\Firebase.Analytics.csproj", "{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C5B2256A-D3E4-4419-9486-1020885EE738}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5B2256A-D3E4-4419-9486-1020885EE738}.Release|Any CPU.Build.0 = Release|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D6AA184C-DA45-4BBB-988A-451B20C7B804}.Release|Any CPU.Build.0 = Release|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,147 @@
using System;
using UIKit;
using Foundation;
using ObjCRuntime;
using CoreGraphics;
namespace Firebase.RemoteConfig
{
// typedef void (^FIRRemoteConfigFetchCompletion)(FIRRemoteConfigFetchStatus, NSError * _Nullable);
delegate void RemoteConfigFetchCompletionHandler (RemoteConfigFetchStatus status, [NullAllowed] NSError error);
// @interface FIRRemoteConfigValue : NSObject <NSCopying>
[DisableDefaultCtor]
[BaseType (typeof (NSObject), Name = "FIRRemoteConfigValue")]
interface RemoteConfigValue : INSCopying
{
// @property (readonly, nonatomic) NSString * _Nullable stringValue;
[NullAllowed]
[Export ("stringValue")]
NSString NSStringValue { get; }
// @property (readonly, nonatomic) NSNumber * _Nullable numberValue;
[NullAllowed]
[Export ("numberValue")]
NSNumber NumberValue { get; }
// @property (readonly, nonatomic) NSData * _Nonnull dataValue;
[Export ("dataValue")]
NSData DataValue { get; }
// @property (readonly, nonatomic) BOOL boolValue;
[Export ("boolValue")]
bool BoolValue { get; }
// @property (readonly, nonatomic) FIRRemoteConfigSource source;
[Export ("source")]
RemoteConfigSource Source { get; }
}
// @interface FIRRemoteConfigSettings : NSObject
[BaseType (typeof (NSObject), Name = "FIRRemoteConfigSettings")]
interface RemoteConfigSettings
{
// @property (readonly, nonatomic) BOOL isDeveloperModeEnabled;
[Export ("isDeveloperModeEnabled")]
bool IsDeveloperModeEnabled { get; }
// -(FIRRemoteConfigSettings * _Nullable)initWithDeveloperModeEnabled:(BOOL)developerModeEnabled __attribute__((objc_designated_initializer));
[DesignatedInitializer]
[Export ("initWithDeveloperModeEnabled:")]
IntPtr Constructor (bool developerModeEnabled);
}
// @interface FIRRemoteConfig : NSObject <NSFastEnumeration>
[DisableDefaultCtor]
[BaseType (typeof (NSObject), Name = "FIRRemoteConfig")]
interface RemoteConfig
{
// extern NSString *const _Nonnull FIRNamespaceGoogleMobilePlatform;
[Field ("FIRNamespaceGoogleMobilePlatform", "__Internal")]
NSString GoogleMobilePlatformNamespace { get; }
// extern NSString *const _Nonnull FIRRemoteConfigThrottledEndTimeInSecondsKey;
[Field ("FIRRemoteConfigThrottledEndTimeInSecondsKey", "__Internal")]
NSString ThrottledEndTimeInSecondsKey { get; }
// extern NSString *const _Nonnull FIRRemoteConfigErrorDomain;
[Field ("FIRRemoteConfigErrorDomain", "__Internal")]
NSString ErrorDomain { get; }
// @property (readonly, nonatomic, strong) NSDate * _Nullable lastFetchTime;
[NullAllowed]
[Export ("lastFetchTime", ArgumentSemantic.Strong)]
NSDate LastFetchTime { get; }
// @property (readonly, assign, nonatomic) FIRRemoteConfigFetchStatus lastFetchStatus;
[Export ("lastFetchStatus", ArgumentSemantic.Assign)]
RemoteConfigFetchStatus LastFetchStatus { get; }
// @property (readwrite, nonatomic, strong) FIRRemoteConfigSettings * _Nonnull configSettings;
[Export ("configSettings", ArgumentSemantic.Strong)]
RemoteConfigSettings ConfigSettings { get; set; }
// +(FIRRemoteConfig * _Nonnull)remoteConfig;
[Static]
[Export ("remoteConfig")]
RemoteConfig SharedInstance { get; }
// -(void)fetchWithCompletionHandler:(FIRRemoteConfigFetchCompletion _Nullable)completionHandler;
[Export ("fetchWithCompletionHandler:")]
void Fetch ([NullAllowed] RemoteConfigFetchCompletionHandler completionHandler);
// -(void)fetchWithExpirationDuration:(NSTimeInterval)expirationDuration completionHandler:(FIRRemoteConfigFetchCompletion _Nullable)completionHandler;
[Export ("fetchWithExpirationDuration:completionHandler:")]
void Fetch (double expirationDuration, [NullAllowed] RemoteConfigFetchCompletionHandler completionHandler);
// -(BOOL)activateFetched;
[Export ("activateFetched")]
bool ActivateFetched ();
// -(FIRRemoteConfigValue * _Nonnull)configValueForKey:(NSString * _Nullable)key;
[Export ("configValueForKey:")]
RemoteConfigValue GetConfigValue ([NullAllowed] string key);
// -(FIRRemoteConfigValue * _Nonnull)configValueForKey:(NSString * _Nullable)key namespace:(NSString * _Nullable)aNamespace;
[Export ("configValueForKey:namespace:")]
RemoteConfigValue GetConfigValue ([NullAllowed] string key, [NullAllowed] string aNamespace);
// -(FIRRemoteConfigValue * _Nonnull)configValueForKey:(NSString * _Nullable)key namespace:(NSString * _Nullable)aNamespace source:(FIRRemoteConfigSource)source;
[Export ("configValueForKey:namespace:source:")]
RemoteConfigValue GetConfigValue ([NullAllowed] string key, [NullAllowed] string aNamespace, RemoteConfigSource source);
// -(NSArray<NSString *> * _Nonnull)allKeysFromSource:(FIRRemoteConfigSource)source namespace:(NSString * _Nullable)aNamespace;
[Export ("allKeysFromSource:namespace:")]
string [] GetAllKeys (RemoteConfigSource source, [NullAllowed] string aNamespace);
// -(NSSet<NSString *> * _Nonnull)keysWithPrefix:(NSString * _Nullable)prefix;
[Export ("keysWithPrefix:")]
NSSet<NSString> GetKeys ([NullAllowed] string prefix);
// -(NSSet<NSString *> * _Nonnull)keysWithPrefix:(NSString * _Nullable)prefix namespace:(NSString * _Nullable)aNamespace;
[Export ("keysWithPrefix:namespace:")]
NSSet<NSString> GetKeys ([NullAllowed] string prefix, [NullAllowed] string aNamespace);
// -(void)setDefaults:(NSDictionary<NSString *,NSObject *> * _Nullable)defaults;
[Export ("setDefaults:")]
void SetDefaults ([NullAllowed] NSDictionary defaults);
// -(void)setDefaults:(NSDictionary<NSString *,NSObject *> * _Nullable)defaultConfig namespace:(NSString * _Nullable)aNamespace;
[Export ("setDefaults:namespace:")]
void SetDefaults ([NullAllowed] NSDictionary defaultConfig, [NullAllowed] string aNamespace);
// -(void)setDefaultsFromPlistFileName:(NSString * _Nullable)fileName;
[Export ("setDefaultsFromPlistFileName:")]
void SetDefaults ([NullAllowed] string plistFileName);
// -(void)setDefaultsFromPlistFileName:(NSString * _Nullable)fileName namespace:(NSString * _Nullable)aNamespace;
[Export ("setDefaultsFromPlistFileName:namespace:")]
void SetDefaults ([NullAllowed] string plistFileName, [NullAllowed] string aNamespace);
// -(FIRRemoteConfigValue * _Nullable)defaultValueForKey:(NSString * _Nullable)key namespace:(NSString * _Nullable)aNamespace;
[Export ("defaultValueForKey:namespace:")]
[return: NullAllowed]
RemoteConfigValue GetDefaultValue ([NullAllowed] string key, [NullAllowed] string aNamespace);
}
}

Просмотреть файл

@ -0,0 +1,21 @@
using System;
namespace Firebase.RemoteConfig
{
public partial class RemoteConfigValue
{
public string StringValue {
get {
return NSStringValue.ToString ();
}
}
}
public partial class RemoteConfig
{
public RemoteConfigValue this [string key] {
get {
return GetConfigValue (key);
}
}
}
}

Просмотреть файл

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C5B2256A-D3E4-4419-9486-1020885EE738}</ProjectGuid>
<ProjectTypeGuids>{8FFB629D-F513-41CE-95D2-7ECE97B6EEEC};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Firebase.RemoteConfig</RootNamespace>
<AssemblyName>Firebase.RemoteConfig</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="FirebaseRemoteConfig.linkwith.cs">
<DependentUpon>FirebaseRemoteConfig</DependentUpon>
</Compile>
<Compile Include="Extension.cs" />
</ItemGroup>
<ItemGroup>
<ObjcBindingApiDefinition Include="ApiDefinition.cs" />
</ItemGroup>
<ItemGroup>
<ObjcBindingCoreSource Include="Structs.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Firebase.RemoteConfig.targets" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Firebase.Analytics\source\Firebase.Analytics\Firebase.Analytics.csproj">
<Project>{87BB564C-85A8-4EC1-AD16-EC0A1ACCEE56}</Project>
<Name>Firebase.Analytics</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Firebase.InstanceID\source\Firebase.InstanceID\Firebase.InstanceID.csproj">
<Project>{D6AA184C-DA45-4BBB-988A-451B20C7B804}</Project>
<Name>Firebase.InstanceID</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.ObjCBinding.CSharp.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_FirebaseRemoteConfigAssemblyName>Firebase.RemoteConfig, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</_FirebaseRemoteConfigAssemblyName>
<_FirebaseRemoteConfigItemsFolder>FRmtC-1.3.0</_FirebaseRemoteConfigItemsFolder>
<_GoogleIPhoneUtilitiesItemsFolder>GIPhnU-1.2.1</_GoogleIPhoneUtilitiesItemsFolder>
</PropertyGroup>
<ItemGroup Condition="'$(OutputType)'!='Library' OR '$(IsAppExtension)'=='True'">
<XamarinBuildDownload Include="$(_FirebaseRemoteConfigItemsFolder)">
<Url>https://www.gstatic.com/cpdc/beaa3b609041eec7/FirebaseRemoteConfig-1.3.0.tar.gz</Url>
<Kind>Tgz</Kind>
</XamarinBuildDownload>
<XamarinBuildDownload Include="$(_GoogleIPhoneUtilitiesItemsFolder)">
<Url>https://www.gstatic.com/cpdc/d6579239fea27cae-GoogleIPhoneUtilities-1.2.1.tar.gz</Url>
<Kind>Tgz</Kind>
</XamarinBuildDownload>
<XamarinBuildRestoreResources Include="_FirebaseRemoteConfigItems" />
</ItemGroup>
<Target Name="_FirebaseRemoteConfigItems">
<PropertyGroup>
<_FirebaseRemoteConfigSDKBaseFolder>$(XamarinBuildDownloadDir)$(_FirebaseRemoteConfigItemsFolder)\Frameworks\frameworks\</_FirebaseRemoteConfigSDKBaseFolder>
<_GoogleIPhoneUtilitiesSDKBaseFolder>$(XamarinBuildDownloadDir)$(_GoogleIPhoneUtilitiesItemsFolder)\Frameworks\</_GoogleIPhoneUtilitiesSDKBaseFolder>
</PropertyGroup>
<ItemGroup>
<RestoreAssemblyResource Include="$(_FirebaseRemoteConfigSDKBaseFolder)FirebaseRemoteConfig.framework\FirebaseRemoteConfig">
<LogicalName>FirebaseRemoteConfig</LogicalName>
<AssemblyName>$(_FirebaseRemoteConfigAssemblyName)</AssemblyName>
</RestoreAssemblyResource>
<RestoreAssemblyResource Include="$(_GoogleIPhoneUtilitiesSDKBaseFolder)GoogleIPhoneUtilities.framework\GoogleIPhoneUtilities">
<LogicalName>GoogleIPhoneUtilities</LogicalName>
<AssemblyName>$(_FirebaseRemoteConfigAssemblyName)</AssemblyName>
</RestoreAssemblyResource>
</ItemGroup>
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,13 @@
using System;
using ObjCRuntime;
[assembly: LinkWith ("FirebaseRemoteConfig",
LinkTarget.ArmV7 | LinkTarget.Arm64 | LinkTarget.Simulator | LinkTarget.Simulator64,
LinkerFlags = "-lsqlite3 -lz",
SmartLink = true,
ForceLoad = true)]
[assembly: LinkWith ("GoogleIPhoneUtilities",
LinkTarget.ArmV7 | LinkTarget.Arm64 | LinkTarget.Simulator | LinkTarget.Simulator64,
SmartLink = true,
ForceLoad = true)]

Просмотреть файл

@ -0,0 +1,34 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using Foundation;
// This attribute allows you to mark your assemblies as “safe to link”.
// When the attribute is present, the linker—if enabled—will process the assembly
// even if youre using the “Link SDK assemblies only” option, which is the default for device builds.
[assembly: LinkerSafe]
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("Firebase.RemoteConfig")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("Microsoft")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.0.0.0")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

Просмотреть файл

@ -0,0 +1,30 @@
using System;
using ObjCRuntime;
namespace Firebase.RemoteConfig
{
[Native]
public enum RemoteConfigFetchStatus : long
{
NoFetchYet,
Success,
Failure,
Throttled
}
[Native]
public enum RemoteConfigError : long
{
Unknown = 8001,
Throttled = 8002,
InternalError = 8003
}
[Native]
public enum RemoteConfigSource : long
{
Remote,
Default,
Static
}
}

Двоичные данные
icons/firebaseiosremoteconfig_128x128.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 12 KiB

Двоичные данные
icons/firebaseiosremoteconfig_512x512.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 89 KiB