Additional setup for Corona Native? (com.onesignal.SyncJobService)

I’m guessing the documentation at https://documentation.onesignal.com/docs/corona-sdk-setup is a little out of date.

I’m updating an older Android project and as part of that I picked up the latest JARs / so for corona onesignal.

When  my app initializes I get a fatal exception:

01-17 14:33:07.122 3025-3057/com.mycompany.myapp I/Corona: Starting Corona OneSignal SDK v1.13.3

01-17 14:08:53.033 2104-2141/? E/AndroidRuntime: FATAL EXCEPTION: FocusHandlerThread Process: com.sporcle.android.sporclelive, PID: 2104 java.lang.IllegalArgumentException: No such service ComponentInfo{com.mycompany.myapp/com.onesignal.SyncJobService}

The documentation above doesn’t mention anything about SyncJobService, which would likely explain my issue.  What changes do I need to make to my AndroidManifest.xml to support this version of your plugin?

Thanks.

Answering my own question perhaps?

In the OneSignal plugin package I looked at metadata.lua and noticed the following entry:

 \<service android:name="com.onesignal.SyncJobService" android:permission="android.permission.BIND\_JOB\_SERVICE" /\>

I added this to my AndroidManifest.xml and it seems to have fixed my issue.  However I noticed there are some other entries (in metadata.lua) that are also missing from my file.

Although things appear to be working, I’d appreciate confirmation about what items specifically need to be in my app’s manifest file.

Unless the plugin builder made a mistake usually all the items in the metadata.lua file are needed for the version that was packaged. If you are using an updated .jar from the Onesignal site, you will have to ask OneSignal or look at the native Android integration steps on the OneSignal website.

I’ve contacted OneSignal and they seem unaware that their documentation is out of date.   However I’ve let them know about the issue with SyncJobService.

What is also interesting is that there are syntax errors in their metadata.lua file that is presumably used by Corona to create Android builds.  These entries appear multiple times:

          <service android:name=“com.onesignal.SyncService” android:stopWithTask=“false” />

          <activity android:name=“com.onesignal.PermissionsActivity” android:theme="@android:style/Theme.Translucent.NoTitleBar" />

Answering my own question perhaps?

In the OneSignal plugin package I looked at metadata.lua and noticed the following entry:

 \<service android:name="com.onesignal.SyncJobService" android:permission="android.permission.BIND\_JOB\_SERVICE" /\>

I added this to my AndroidManifest.xml and it seems to have fixed my issue.  However I noticed there are some other entries (in metadata.lua) that are also missing from my file.

Although things appear to be working, I’d appreciate confirmation about what items specifically need to be in my app’s manifest file.

Unless the plugin builder made a mistake usually all the items in the metadata.lua file are needed for the version that was packaged. If you are using an updated .jar from the Onesignal site, you will have to ask OneSignal or look at the native Android integration steps on the OneSignal website.

I’ve contacted OneSignal and they seem unaware that their documentation is out of date.   However I’ve let them know about the issue with SyncJobService.

What is also interesting is that there are syntax errors in their metadata.lua file that is presumably used by Corona to create Android builds.  These entries appear multiple times:

          <service android:name=“com.onesignal.SyncService” android:stopWithTask=“false” />

          <activity android:name=“com.onesignal.PermissionsActivity” android:theme="@android:style/Theme.Translucent.NoTitleBar" />