Sunday, 15 January 2012

mono - MonoDroid device registeration for push notifications using PushSharp -



mono - MonoDroid device registeration for push notifications using PushSharp -

in monodroid application have problem registering devices force notifications using pushsharp. general force notification setup works fine on newer devices such sgs2, sgs3 , nexus7, on legend , hero running 2.2 , 2.2.1 registration fails in release (works fine in debug). have narrowed downwards problem startservice call:

var intent = new intent(gcmconstants.intent_to_gcm_registration); intent.setpackage(gsf_package); intent.putextra(gcmconstants.extra_application_pending_intent, pendingintent.getbroadcast(context, 0, new intent(), 0)); intent.putextra(gcmconstants.extra_sender, senders); context.startservice(intent);

the manifest file looks fine:

<uses-sdk android:minsdkversion="8" android:targetsdkversion="10" /> <uses-permission android:name="android.permission.internet" /> ... <!-- google cloud messaging (gcm) force messages --> <permission android:name="my.package.name.permission.c2d_message" android:protectionlevel="signature" /> <uses-permission android:name="my.package.name.permission.c2d_message" /> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <uses-permission android:name="android.permission.wake_lock" />

the intent looks fine (act=com.google.android.c2dm.intent.register pkg=com.google.android.gsf) , senderid correct, gcmintentservice onreceive method never triggered...

sometimes next error message can seen using logcat (although not consistently):

e/c2dmregistrar( 302): [c2dmreg] handlerequest caught java.io.ioexception: ssl shutdown failed: i/o error during scheme call, broken pipe.

i not sure how solve problem , appreciate help.

thanks peter

you don't need these permissions should set within pushsharp code...

<permission android:name="my.package.name.permission.c2d_message" android:protectionlevel="signature" /> <uses-permission android:name="my.package.name.permission.c2d_message" /> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" />

mono monodroid google-cloud-messaging pushsharp

No comments:

Post a Comment