williamrijksen / com.williamrijksen.onesignal

Titanium Appcelerator Library for OneSignal Push Notifications Service
Other
51 stars 43 forks source link

iOS SDK Updates #86

Closed chmiiller closed 4 years ago

chmiiller commented 5 years ago

Hi there, I've noticed that there are a bunch of important issues fixed on the latest releases of the original One Signal SDK for iOS and this module is becoming obsolete if we don't do something about it along with a lot of other cool features that the module misses.

The two more relevant issues are:

85 and https://github.com/OneSignal/OneSignal-iOS-SDK/issues/522

We can start by merging all @williamrijksen open PRs and maybe ask from some official support from One Signal guys. I wish I could contribute more to this project but I don't have so much experience with Objective-C ¯_(ツ)_/¯

Thanks!

pitbot commented 4 years ago

I'm not familiar enough with native stuff to really help here with any new features but I did manage to get it working with iOS 13 (and stop the UIWebView warnings) by following the build yourself section to update the iOS SDK to latest, then using that version of the module. It's not really a long term solution but might be helpful for the time being.

chmiiller commented 4 years ago

Is good to hear that simply building it with latest iOS SDK does the job! Thanks!

chmiiller commented 4 years ago

Posted on their repo as well: https://github.com/OneSignal/OneSignal-iOS-SDK/issues/540

joshualambert commented 4 years ago

@pitbot Any chance you could share a copy of your updated/compiled OneSignal module? I've been unable to get it compiled locally.

pitbot commented 4 years ago

@joshualambert I've put the version I used here: https://github.com/pitbot/com.williamrijksen.onesignal/tree/master/dist

ulissesrsilva commented 4 years ago

@joshualambert I've put the version I used here: https://github.com/pitbot/com.williamrijksen.onesignal/tree/master/dist

Hey @pitbot, thanks for sharing! I'm using your your updated module with 8.2.0.GA but all of my users keep getting "Other Apns 3000 Error - " on One Signal. I've configured all certificates correctly. Do you know what it might be?

pitbot commented 4 years ago

@ulissesrsilva I’m afraid I don’t know. I kinda just brute forced this and its working on my app. Are you using rich notifications or have set up the capabilities? That error looks like it’s related to entitlements usually. I’m no expert though - sorry!

chmiiller commented 4 years ago

hey @ulissesrsilva I've JUST had this problem last Friday! For a mysterious reason, my provisioning profile was marked as invalid on the Apple Developer dashboard! If you take the generated .IPA file, you can easily see the provisioning profile used to sign the app and you will see that it misses the entitlement aps-environment: production. I had to generate the provisioning profile again, this time I double checked it, the entitlement was there and resubmit the app. Then all my iOS users started to get Push Notifications again. Probably you got an email from Apple App Store Connect saying "Missing push entitlement" when the app was submitted. I've received and somehow ignored 😬 This has nothing to do with an updated version of the SDK and can happen if the provisioning is missing the entitlement for any reason. There is an issue about it on the original iOS repo as well. I think the error message from One Signal could be improved tbh

ulissesrsilva commented 4 years ago

hey @ulissesrsilva I've JUST had this problem last Friday! For a mysterious reason, my provisioning profile was marked as invalid on the Apple Developer dashboard! If you take the generated .IPA file, you can easily see the provisioning profile used to sign the app and you will see that it misses the entitlement aps-environment: production. I had to generate the provisioning profile again, this time I double checked it, the entitlement was there and resubmit the app. Then all my iOS users started to get Push Notifications again. Probably you got an email from Apple App Store Connect saying "Missing push entitlement" when the app was submitted. I've received and somehow ignored 😬 This has nothing to do with an updated version of the SDK and can happen if the provisioning is missing the entitlement for any reason. There is an issue about it on the original iOS repo as well. I think the error message from One Signal could be improved tbh

Hey @chmiiller thank you so much!!! I updated my tiapp.xml with the aps-environment and it works just fine now!

albert0m commented 4 years ago

After updating to Xcode 11 I got the same problem. I tried everything suggested here, but I'm still not getting the userId. The device is not registering to the OneSignal backend anymore, they're not marked as active anymore.

I rebuilt the module myself like suggested, updating the original sdk but still the idsAvailable method was not called. Migrated the method (since it's been marked as deprecated) and used OSPermissionSubscriptionState with the observer, but still the userId is not generated. What else could I try? Users using old apps are still receiving push notifications and beking marked as active.

I downgraded Xcode to 10 and reverted to old Titanium SDKs and OneSignal libraries, but still without much success.

pitbot commented 4 years ago

@albert0m did you try requiring the onesignal module as early as possible? Initially it wasn't working correctly for me but moving the require to the top of app.js fixed it.

chmiiller commented 4 years ago

@albert0m are you talking about this Deprecation message when building the app?

OneSignal has detected that your application delegate implements a deprecated method (application:didReceiveLocalNotification:). Please note that this method has been officially deprecated and the OneSignal SDK will no longer call it. You should use UNUserNotificationCenter instead

This might be the reason it is not working properly

chmiiller commented 4 years ago

BTW, @pitbot I've tried your build https://github.com/pitbot/com.williamrijksen.onesignal/tree/master/dist and still gets this warning messages from above (Xcode 10)

chmiiller commented 4 years ago

Hi everyone, good news, I have updated the module on PR #88 The iOS SDK is updated so it doesn't include UIWebView anymore, works with Xcode 11 and doesn't give warning anymore =) I've tested building with Xcode 10 and 11, Titanium SDK 8.3.x and tags, notifications and callbacks are all working. The final test will be to submit the app to store, but that will only happen in a couple of weeks. So, finally closing this issue. Thanks!