Search code examples
push-notificationxamarin.androidblackberry-10

Enabling Push Notification Xamarin.Android runtime BB 10 App


I am following this doc to enable push in Xamarin.Android runtime BB10 app. I am confused where & when exactly to put android.cfg file.

  • Before creating apk, added cfg file in root of project in application name (tried naming as android.cfg also).

  • Using that apk, I generated .bar file, but under android folder, res folder and apk file only exist, cfg file doesn't seems to be exist.

  • Then I tried adding cfg file under bar file after creating apk but before signing bar file, but I started getting following error:

Error: No manifest. Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.rim.tools.signing.SigningMain.main(SigningMain.java:72) Caused by: java.lang.Exception: java.lang.RuntimeException: No manifest. at net.rim.device.codesigning.barsigner.BarSigner.if(Unknown Source) at net.rim.device.codesigning.barsigner.BarSigner.main(Unknown Source) ... 5 more Caused by: java.lang.RuntimeException: No manifest. at net.rim.device.codesigning.barsigner.BarSigner.try(Unknown Source) ... 7 more

I have ppgurl, appid which I got from BB.

What is the exact procedure for this? In same doc following thing is given:

The Google Play Services SDK is not supported on BlackBerry 10. If your app includes GCM services, you must set up your Android project to use the stand-alone GCM SDK. Android Studio does not support the use of the stand-alone GCM SDK at this time. For more information see Android Studio Overview.

I am using GCM Client component for push in Xamarin.Android. What is stand alone GCM SDK given in doc?. I don't know what kind of GCM I am using.


Solution

  • I fixed above issue and now I am receiving push notification successfully in my BlackBerry device. In different places different location is given to place android.cfg file, but actual location which worked for me is:

    android.cfg file under assets/blackberry/android.cfg

    Place this file before creating apk. Because in many places I read to put this file after creating apk using zip tool, that may also work, but if it is not working try the solution given here :)

    I followed procedures exactly given in below docs.

    https://github.com/blackberry/BB10-Android-Runtime-Samples/tree/master/SamplePushClient