Skip to content

Commit

Permalink
Cleanup file hierarchy and clarify it in manual installation section …
Browse files Browse the repository at this point in the history
…of readme
  • Loading branch information
bobeast committed Dec 19, 2012
1 parent 24b0e18 commit e25e44d
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 11 deletions.
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,28 @@ This plugin is for use with [Cordova](http://incubator.apache.org/cordova/), and

## Manual Installation for Android

Add the **com.google.android.gcm** and **com.plugin.GCM** packages to your project's src directory.

Modify your **AndroidManifest.xml** and add the following lines to your manifest tag, replacing **your_app_package** with your app's package path:
1) copy the contents of **src/android/com/** to your project's **src/com/** folder. The final hirearchy will likely look something like this;

{project_folder}
src
com
google
android
gcm
GCMBaseIntentService.java
GCMBroadcastReceiver.java
GCMConstants.java
GCMIntentService.java
GCMRegistrar.java
plugin
GCM
PushPlugin.java
{company_name}
{intent_name}
{intent_name}.java

2) Modify your **AndroidManifest.xml** and add the following lines to your manifest tag, replacing **your_app_package** with your app's package path:


<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand All @@ -48,7 +67,7 @@ Modify your **AndroidManifest.xml** and add the following lines to your manifest
<uses-permission android:name="your_app_package.permission.C2D_MESSAGE" />


Modify your **AndroidManifest.xml** and add the **receiver** and **service** tags to your **application** section, replacing **your_app_package** with your app's package path: (See the Sample_AndroidManifest.xml file in the Example folder.)
3) Modify your **AndroidManifest.xml** and add the **receiver** and **service** tags to your **application** section, replacing **your_app_package** with your app's package path: (See the Sample_AndroidManifest.xml file in the Example folder.)


<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
Expand All @@ -60,11 +79,11 @@ Modify your **AndroidManifest.xml** and add the **receiver** and **service** tag
</receiver>
<service android:name="com.google.android.gcm.GCMIntentService" />

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) 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)

<plugin name="PushPlugin" value="com.plugin.GCM.PushPlugin" />

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.
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.

<script type="text/javascript" charset="utf-8" src="PushNotification.js"></script>

Expand Down
12 changes: 6 additions & 6 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
<service android:name="com.google.android.gcm.GCMIntentService" />
</config-file>

<source-file src="src/android/gcm/GCMBaseIntentService.java" target-dir="src/com/google/android/gcm/" />
<source-file src="src/android/gcm/GCMBroadcastReceiver.java" target-dir="src/com/google/android/gcm/" />
<source-file src="src/android/gcm/GCMConstants.java" target-dir="src/com/google/android/gcm/" />
<source-file src="src/android/gcm/GCMRegistrar.java" target-dir="src/com/google/android/gcm/" />
<source-file src="src/android/gcm/GCMIntentService.java" target-dir="src/com/google/android/gcm/" />
<source-file src="src/android/plugin/PushPlugin.java" target-dir="src/com/plugin/GCM/" />
<source-file src="src/android/com/google/android/gcm/GCMBaseIntentService.java" target-dir="src/com/google/android/gcm/" />
<source-file src="src/android/com/google/android/gcm/GCMBroadcastReceiver.java" target-dir="src/com/google/android/gcm/" />
<source-file src="src/android/com/google/android/gcm/GCMConstants.java" target-dir="src/com/google/android/gcm/" />
<source-file src="src/android/com/google/android/gcm/GCMRegistrar.java" target-dir="src/com/google/android/gcm/" />
<source-file src="src/android/com/google/android/gcm/GCMIntentService.java" target-dir="src/com/google/android/gcm/" />
<source-file src="src/android/com/plugin/GCM/PushPlugin.java" target-dir="src/com/plugin/GCM/" />

</platform>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e25e44d

Please sign in to comment.