android - C2DM / Phonegap plugin? -
android - C2DM / Phonegap plugin? -
i add together force messaging phonegap android app , believe c2dm waybest way create work - point me in right direction set up? there plugin or tutorial help this?
also - need plugin - possible add together c2dm app traditional android way without messing phonegap setup?
yes, c2dm android force solution. on https://github.com/awysocki/c2dm-phonegap can find illustration implementation.
the files in com.google namespace have included unchanged, session "google io session overview: android + app engine: developer’s dream combination", see http://bradabrams.com/2011/05/google-io-session-overview-android-app-engine-a-developers-dream-combination/
so these steps should perform:
add 3 com.google classes project create class calledc2dmreceiver
(naming convention) inherits c2dmbasereceiver
, implement necessary abstract events set androidmanifest.xml the androidmanifest looks like
<!-- set own permission secure our c2dm mesages --> <permission android:name="your.namespace.permission.c2d_message" android:protectionlevel="signature" /> <!-- list of permission --> <uses-permission android:name="your.namespace.permission.c2d_message" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.wake_lock" /> <application ..> <!-- implementation of class c2dmreceiver, base of operations class googles c2dmbasereceiver --> <service android:name=".c2dmreceiver" /> <!-- googles broadcast receiver, delegates your.namespace.c2dmreceiver --> <receiver android:name="com.google.android.c2dm.c2dmbroadcastreceiver" android:permission="com.google.android.c2dm.permission.send"> <intent-filter> <action android:name="com.google.android.c2dm.intent.receive" /> <category android:name="your.namespace" /> </intent-filter> <intent-filter> <action android:name="com.google.android.c2dm.intent.registration" /> <category android:name="your.namespace" /> </intent-filter> </receiver> </application>
if receive on emulator error "e/cse notifications(401): registration error account_missing", have add together google business relationship emulator.
for sec question: depends want do. when receive message , want display notification user able start app don't need phonegap plugin. in case can solve in java.
android jquery-mobile cordova android-c2dm
Comments
Post a Comment