Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Additional setup for Corona Native? (com.onesignal.SyncJobService)
Started by nandgate Jan 17 2019 02:46 PM

3 replies to this topic
android native onesignal
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

nandgate

[GLOBAL: userInfoPane.html]
nandgate
  • Enthusiast

  • 84 posts
  • Corona SDK

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.

 



[TOPIC: post.html]
#2

nandgate

[GLOBAL: userInfoPane.html]
nandgate
  • Enthusiast

  • 84 posts
  • Corona SDK

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.



[TOPIC: post.html]
#3

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,152 posts
  • Corona SDK

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.



[TOPIC: post.html]
#4

nandgate

[GLOBAL: userInfoPane.html]
nandgate
  • Enthusiast

  • 84 posts
  • Corona SDK

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" />
 



[topic_controls]
[/topic_controls]