rdelrosario / xamarin-plugins

Cross platform Xamarin & Windows plugins for PCLs
MIT License
178 stars 161 forks source link

SERVICE_NOT_AVAILABLE #6

Closed pavan7parekh closed 9 years ago

pavan7parekh commented 9 years ago

I got 1 error message in CrossPushNotificationListener's IPushNotificationListener.OnError method

Error :

CrossPushNotification - Register - Java.IO.IOException: Exception of type 'Java.IO.IOException' was thrown. at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in :0 at Android.Runtime.JNIEnv.CallObjectMethod (IntPtr jobject, IntPtr jmethod, Android.Runtime.JValue[] parms) [0x00000] in :0 at Android.Gms.Gcm.GoogleCloudMessaging.Register (System.String[] senderIds) [0x00000] in :0 at PushNotification.Plugin.PushNotificationImplementation+<>cDisplayClass7.b6 () [0x00000] in c:\xamarin-plugins\PushNotification\PushNotification\PushNotification.Plugin.Android\PushNotificationImplementation.cs:230 at System.Threading.Tasks.TaskActionInvoker+FuncInvoke1[System.String].Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0 at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0 at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 at System.Runtime.CompilerServices.TaskAwaiter1[System.String].GetResult () [0x00000] in :0 at PushNotification.Plugin.PushNotificationImplementation+d__9.MoveNext () [0x00058] in c:\xamarin-plugins\PushNotification\PushNotification\PushNotification.Plugin.Android\PushNotificationImplementation.cs:228 --- End of managed exception stack trace --- java.io.IOException: SERVICE_NOT_AVAILABLE at com.google.android.gms.gcm.GoogleCloudMessaging.register(Unknown Source) at dalvik.system.NativeStart.run(Native Method)

rdelrosario commented 9 years ago

Hi

Seems to be failing when trying to register. See this posts.

http://stackoverflow.com/q/17188982/4700871

http://stackoverflow.com/q/7514038/4700871

I am already working on a fix. Which will be retrying to register when i get this extra on the intent.

pavan7parekh commented 9 years ago

Hi @rdelrosario thank you so much for reply. Whenever you fix this, please tell/ping me.

rdelrosario commented 9 years ago

Hi

Please try the solutions written on this post:

http://eladnava.com/google-cloud-messaging-extremely-unreliable/

Let me know if still have the problem after trying this out.

pavan7parekh commented 9 years ago

Hi @rdelrosario ,

Thank you so much Now, it's work fine.

nielscup commented 8 years ago

Hi, I got the same error on Unregister, see stacktrace below, but I am unable to reproduce this error. Would it be possible to apply the same fix on the unregister?

CoreAppStart:PushNotificationOnError:Diagnostic: 19.10 PushNotification - Unregister - Java.IO.IOException: SERVICE_NOT_AVAILABLE at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0 at Android.Runtime.JNIEnv.CallVoidMethod (IntPtr jobject, IntPtr jmethod, Android.Runtime.JValue* parms) [0x00069] in :0 at Android.Gms.Gcm.Iid.InstanceID.DeleteToken (System.String authorizedEntity, System.String scope) [0x00081] in :0 at PushNotification.Plugin.PushNotificationImplementation+<>c.b__10_0 (System.Object state) [0x0000a] in C:\xamarin-plugins\PushNotification\PushNotification\PushNotification.Plugin.Android\PushNotificationImplementation.cs:109