Commit 302f6917 authored by Eddy Verbruggen's avatar Eddy Verbruggen
Browse files

Merge pull request #259 from Telerik-Verified-Plugins/master

Various (manually) merged changes
parents 81fc2010 0a3770ab
Loading
Loading
Loading
Loading
+10 −2
Changes for README.md: 10 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -163,7 +163,15 @@ The final hierarchy will likely look something like this:
<service android:name="com.plugin.gcm.GCMIntentService" />
```

4) Modify your `res/xml/config.xml` to include the following line in order to tell Cordova to include this plugin and where it can be found: (See the Sample_config.xml file in the Example folder)
4) Check that the launch mode for the main Cordova Activity is one of the **[singleXXX](http://developer.android.com/guide/topics/manifest/activity-element.html#lmode)** options in **AndroidManifest.xml**.

```xml
<activity ... android:launchMode="singleTop">
```

Otherwise a new activity instance, with a new webview, will be created when activating the notifications.

5) Modify your `res/xml/config.xml` to include the following line in order to tell Cordova to include this plugin and where it can be found: (See the Sample_config.xml file in the Example folder)

```xml
<feature name="PushPlugin">
@@ -171,7 +179,7 @@ The final hierarchy will likely look something like this:
</feature>
```

5) Add the `PushNotification.js` script to your assets/www folder (or javascripts folder, wherever you want really) and reference it in your main index.html file. This file's usage is described in the **Plugin API** section below.
6) Add the `PushNotification.js` script to your assets/www folder (or javascripts folder, wherever you want really) and reference it in your main index.html file. This file's usage is described in the **Plugin API** section below.

```html
<script type="text/javascript" charset="utf-8" src="PushNotification.js"></script>
+1 −1
Changes for plugin.xml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:amazon="http://schemas.android.com/apk/lib/com.amazon.device.ads"
    id="com.phonegap.plugins.PushPlugin"
    version="2.2.0">
    version="2.2.1">

  <name>PushPlugin</name>
	<author>Bob Easterday</author>
+3 −1
Changes for src/ios/PushPlugin.m: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -218,11 +218,13 @@
    [self successWithMessage:[NSString stringWithFormat:@"app badge count set to %d", badge]];
}
-(void)successWithMessage:(NSString *)message
{
    if (self.callbackId != nil)
    {
        CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message];
    
        [self.commandDelegate sendPluginResult:commandResult callbackId:self.callbackId];
    }
}

-(void)failWithMessage:(NSString *)message withError:(NSError *)error
{