Merge branch 'master' of github.com:Microsoft/appcenter-sdk-cordova

This commit is contained in:
Patrick Nikoletich 2017-12-13 15:08:06 -08:00
Родитель feb6052930 6930eaada5
Коммит 0a75d9d2d1
9 изменённых файлов: 19 добавлений и 19 удалений

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

@ -30,32 +30,32 @@ This will install all three plugins.
To get it working in your app you will need to add some configuration values to your app configuration in `config.xml` file. See list of available parameters below
- `APP_CENTER_APP_SECRET` - _(required)_ App secret which enables App Center to map this app to the right user account
- `APP_SECRET` - _(required)_ App secret which enables App Center to map this app to the right user account
Example:
```xml
<platform name="android">
<preference name="APP_CENTER_APP_SECRET" value="7a72dae0-f811-451b-8ae8-ecf7973e8359" />
<preference name="APP_SECRET" value="7a72dae0-f811-451b-8ae8-ecf7973e8359" />
</platform>
```
Notice that it's likely that Android and iOS platforms will be associated with different applications on App Center portal so you would need to add this preference twice - one for Android (as in example above) and another for iOS.
- `APP_CENTER_ANALYTICS_ENABLE_IN_JS` - _(optional, default is "false")_ This preference specifies whether Analytics will be enabled automatically (default option) or will require call to `Analytics.setEnabled()` in JS code before sending any usage data to App Center portal. This might be useful e.g. in case when an application may want to ask users whether they want to share analytics information.
- `APPCENTER_ANALYTICS_ENABLE_IN_JS` - _(optional, default is "false")_ This preference specifies whether Analytics will be enabled automatically (default option) or will require call to `Analytics.setEnabled()` in JS code before sending any usage data to App Center portal. This might be useful e.g. in case when an application may want to ask users whether they want to share analytics information.
Example:
```xml
<preference name="APP_CENTER_ANALYTICS_ENABLE_IN_JS" value="true" />
<preference name="APPCENTER_ANALYTICS_ENABLE_IN_JS" value="true" />
```
- `APP_CENTER_CRASHES_ALWAYS_SEND` - _(optional, default is "true")_ Specifies whether crash reports will always be sent automatically or would be available for processing in JavaScript code. Opting to process crashes first means more work for the developer, but greater control over user privacy and allows you to attach a message with a crash report.
- `APPCENTER_CRASHES_ALWAYS_SEND` - _(optional, default is "true")_ Specifies whether crash reports will always be sent automatically or would be available for processing in JavaScript code. Opting to process crashes first means more work for the developer, but greater control over user privacy and allows you to attach a message with a crash report.
Example:
```xml
<preference name="APP_CENTER_CRASHES_ALWAYS_SEND" value="false" />
<preference name="APPCENTER_CRASHES_ALWAYS_SEND" value="false" />
```
### Push configuration

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

@ -14,7 +14,7 @@ import com.microsoft.azure.mobile.AppCenter;
import com.microsoft.azure.mobile.analytics.Analytics;
public class AppCenterAnalyticsPlugin extends CordovaPlugin {
private static final String ENABLE_IN_JS = "APP_CENTER_ANALYTICS_ENABLE_IN_JS";
private static final String ENABLE_IN_JS = "APPCENTER_ANALYTICS_ENABLE_IN_JS";
@Override
public void initialize(CordovaInterface cordova, CordovaWebView webView) {

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

@ -14,7 +14,7 @@
[MSAppCenter startService:[MSAnalytics class]];
BOOL enableInJs = [self.commandDelegate.settings
cordovaBoolSettingForKey:@"APP_CENTER_ANALYTICS_ENABLE_IN_JS"
cordovaBoolSettingForKey:@"APPCENTER_ANALYTICS_ENABLE_IN_JS"
defaultValue:NO];
if (enableInJs) {

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

@ -18,7 +18,7 @@ import com.microsoft.azure.mobile.utils.async.AppCenterConsumer;
import java.util.List;
public class AppCenterCrashesPlugin extends CordovaPlugin {
private static final String ALWAYS_SEND = "APP_CENTER_CRASHES_ALWAYS_SEND";
private static final String ALWAYS_SEND = "APPCENTER_CRASHES_ALWAYS_SEND";
private CordovaCrashListenerBase crashListener;
@Override

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

@ -16,7 +16,7 @@ static BOOL crashProcessingDelayFinished = NO;
- (void)pluginInitialize
{
BOOL sendAutomatically = [self.commandDelegate.settings
cordovaBoolSettingForKey:@"APP_CENTER_CRASHES_ALWAYS_SEND"
cordovaBoolSettingForKey:@"APPCENTER_CRASHES_ALWAYS_SEND"
defaultValue:NO];
[AppCenterShared configureWithSettings:self.commandDelegate.settings];

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

@ -12,7 +12,7 @@ class AppCenterShared {
// TODO: Refine constants
private final static String VERSION_NAME = "0.0.1";
private final static String SDK_NAME = "appcenter.cordova";
private static final String APP_CENTER_APP_SECRET = "APP_CENTER_APP_SECRET";
private static final String APP_SECRET = "APP_SECRET";
private static String appSecret;
private static final WrapperSdk wrapperSdk = new WrapperSdk();
@ -30,7 +30,7 @@ class AppCenterShared {
private static String getAppSecret(CordovaPreferences preferences) {
if (AppCenterShared.appSecret == null) {
AppCenterShared.appSecret = preferences.getString(APP_CENTER_APP_SECRET, null);
AppCenterShared.appSecret = preferences.getString(APP_SECRET, null);
}
return AppCenterShared.appSecret;

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

@ -14,7 +14,7 @@ static MSWrapperSdk * wrapperSdk;
+ (NSString *) getAppSecretWithSettings: (NSDictionary*) settings
{
if (appSecret == nil) {
appSecret = [settings cordovaSettingForKey:@"APP_CENTER_APP_SECRET"];
appSecret = [settings cordovaSettingForKey:@"APP_SECRET"];
// If the AppSecret is not set, we will pass nil to MSAppCenter which will error out, as expected
}

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

@ -6,11 +6,11 @@ To run application and test those capabilities please follow the instructions be
1. Configure Application Secrets for bot iOS and Android
In `config.xml` find `APP_CENTER_APP_SECRET` preference for both iOS and Android platforms and set it's value to application secret as displayed in App Center portal
In `config.xml` find `APP_SECRET` preference for both iOS and Android platforms and set it's value to application secret as displayed in App Center portal
2. Change other plugins preferences if required
Change `APP_CENTER_ANALYTICS_ENABLE_IN_JS` and `APP_CENTER_CRASHES_ALWAYS_SEND` values if you want. By default application is configured to not send analytics automatically to demonstrate/test scenario with programmatic switching App Center Analytics functionality on and off; Crashes plugin is also configured to process crashes in JS rather than send them automatically to demonstrate crashes processing and reports events handling.
Change `APPCENTER_ANALYTICS_ENABLE_IN_JS` and `APPCENTER_CRASHES_ALWAYS_SEND` values if you want. By default application is configured to not send analytics automatically to demonstrate/test scenario with programmatic switching App Center Analytics functionality on and off; Crashes plugin is also configured to process crashes in JS rather than send them automatically to demonstrate crashes processing and reports events handling.
3. Configure Google FCM

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

@ -18,17 +18,17 @@
<allow-intent href="geo:*" />
<!-- Setting to true to be able to test functionality because default is false -->
<preference name="APP_CENTER_ANALYTICS_ENABLE_IN_JS" value="true" />
<preference name="APP_CENTER_CRASHES_ALWAYS_SEND" value="false" />
<preference name="APPCENTER_ANALYTICS_ENABLE_IN_JS" value="true" />
<preference name="APPCENTER_CRASHES_ALWAYS_SEND" value="false" />
<platform name="android">
<preference name="APP_CENTER_APP_SECRET" value="your_android_application_id" />
<preference name="APP_SECRET" value="your_android_application_id" />
<!-- <resource-file src="google-services.json" target="google-services.json" /> -->
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<preference name="APP_CENTER_APP_SECRET" value="your_ios_application_id" />
<preference name="APP_SECRET" value="your_ios_application_id" />
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>