OneSignal problem with iOS native build

Hi.

first of all, i bet your pardon for my terrible english, its not my native language.

here is the point.

I have a problem with setting up a onesignal to native corona project.

i do it by following this manual and encounter a lot of errors on this path.

first of all, on the step 4, i got the issue “error: The sandbox is not in sync with the Podfile.lock. Run ‘pod install’ or update your CocoaPods installation.”

ofcourse, simple running of pod install do nothing.

so, the solution is add two user defined variables in build settings PODS_PODFILE_DIR_PATH and PODS_ROOT.

therefor i got the issue ‘OneSignal/OneSignal.h’ file not found

this problem is resolving by add 

#include “Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig”

#include “Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig”

in CoronaApp.xcconfig

finnally we can build it! :slight_smile:

but the next problem i was not able to resolve

i can see in logs that onesignal is initialized, it can show me a permission dialog, but in one signal dashboard the device has the record “Apns Delegate Never Fired” 

so, there is no push notification income.

in fact, the push token is obtained by device - i was check it in didRegisterForRemoteNotificationsWithDeviceToken.

but for some reason it cant be send to one signal.

logs for a clear ios project and for corona ios project are different too.

i cant see a HTTP Request (OSRequestGetIosParams) with URL with corona project, only a response.

it looks like some framework is overriding impotant methods for onesignal, or something like this.

i can provide a logs if it necessary ( it just need to clean from keys and private info ), but the step i was written above is really easy to repeat and get the same trouble.

i really need to implement onesignal this way, because i have to manage a push notification on native level…

btw, i tried to do with carthage instead cocoapods, it was a different errors and solutions, but the result was the same.

If you are building a Corona Native app you have to use the iOS SDK built for Corona due to compatibility issues with Corona’s AppDelegate.

https://documentation.onesignal.com/docs/corona-sdk-setup#section-setup-sdk-corona-native-

If you still see “Apns Delegate Never Fired” double check you have followed this step correctly as well, specifically the OneSignalCoronaDelegate part with the plist.

https://documentation.onesignal.com/docs/corona-sdk-setup#section-3-add-plugin-to-ios

thanks to response! 

but how can i manage push notification from oneSignal in native code then? 

All the OneSignal native methods are available in the OneSignal Corona SDK as well. However I am not sure if the OneSignal.h is included. If not you can use the public one here:
https://github.com/OneSignal/OneSignal-iOS-SDK/blob/master/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Headers/OneSignal.h

OneSignal.h is not included, but the public one works great! Thanks, that exactly what i need to :slight_smile:

and btw, i don’t know, is this a issue or not, or maybe is some kind of my local bug, but trying to require it from corona code, i get the plugin error.

2019-12-11 22:32:04.344706+0800 Vizavi[3334:1026718] [DYMTLInitPlatform] platform initialization successful 1010a09501010a09901010a09d01010a09502019-12-11 22:32:05.035527+0800 Vizavi[3334:1026385] Platform: iPhone / iPhone6,1 / 12.4.3 / Apple A7 GPU / OpenGL ES 2.0 Apple A7 GPU - 133.6 / 2019.3559 / ru-RU | RU | ru\_RU | ru 2019-12-11 22:32:05.045938+0800 Vizavi[3334:1026385] ERROR: Runtime error module 'plugin.OneSignal' not found:resource (plugin.OneSignal.lu) does not exist in archive no field package.preload['plugin.OneSignal'] no file '/var/containers/Bundle/Application/DF91DF12-13BF-4E0A-9535-585DD458A831/Vizavi.app/corona-plugins/plugin/OneSignal.lua' no file '/var/containers/Bundle/Application/DF91DF12-13BF-4E0A-9535-585DD458A831/Vizavi.app/plugin/OneSignal.lua' no file '/var/containers/Bundle/Application/DF91DF12-13BF-4E0A-9535-585DD458A831/Vizavi.app/plugin/OneSignal.lua' no file '/var/containers/Bundle/Application/DF91DF12-13BF-4E0A-9535-585DD458A831/Vizavi.app/corona-plugins/plugin/OneSignal.so' no file './plugin/OneSignal.so' no file '/var/containers/Bundle/Application/DF91DF12-13BF-4E0A-9535-585DD458A831/Vizavi.app/plugin/OneSignal.so' no file '/var/containers/Bundle/Application/DF91DF12-13BF-4E0A-9535-585DD458A831/Vizavi.app/corona-plugins/plugin.so' no file './plugin.so' no file '/var/containers/Bundle/Application/DF91DF12-13BF-4E0A-9535-585DD458A831/Viz

( Vizavi - its the name of my app, this log i got from xcode )

all of options is copied from your site, plugin options, init code, etc.

anyway, my code in didFinishLaunchingWithOptions is working well now, so thats all i was need to :slight_smile:

Thank you one more time :slight_smile: