Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OneSignal not working after Xcode 10.0 update #428

Closed
LaloCastilla opened this issue Sep 19, 2018 · 26 comments
Closed

OneSignal not working after Xcode 10.0 update #428

LaloCastilla opened this issue Sep 19, 2018 · 26 comments

Comments

@LaloCastilla
Copy link

LaloCastilla commented Sep 19, 2018

Update from @jkasten2: This issue is a compatibly issue with Cordova and Xcode 10.
See this issue for a work around: apache/cordova-ios#407

Description:

We have updated to the last version of Xcode 10.0 and integrated the last version of the onesignal Cordova SDK to our company application. The App builds without problem. When the app starts we can see our device added to the onesignal dashboard but when we try to send a notification it fails.

At the dashboard we have received a warning that says the following:

"Apple returned a BadDeviceToken error. Some users are tied to a different environment from your sending environment.

This warning occurred 10 times, last occurring half a minute ago.

Affected users: 97f0aa1f-9920-4edc-97fa-fd8170965e2c, 03fdf464-5d86-49ac-b57b-5c93e25448fd, and 94efb08f-9778-4ed9-8ba6-0faffd97b335"

We are using the same push certificate of the app that it is currently in the app store.

We have followed the instructions to integrate the IOS SDK BETA via cocoapods to our ios ionic build, but the same error occurs.

Also we are using the same bundle id.

We were about to make an important update to our app so we need your help.

@Nightsd01
Copy link
Contributor

Nightsd01 commented Sep 20, 2018

After some investigation, it looks like apps built very specifically with Cordova in Xcode 10 seem to be missing the embedded mobile provisioning file.

Our SDK needs to know if your app is a development or production version so it knows what APNS certificate to use. It accomplishes this by reading a file called embedded.mobileprovision from your app's bundle.

This works just fine in iOS 12 + Xcode 10......except with Cordova.

Specifically, the following line returns nil when it should be returning a provisioning file.

[[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]

We are continuing to investigate and may end up filing a bug with Cordova over this - I understand this can be a time critical issue and I apologize that you are seeing it.

@sveeen
Copy link

sveeen commented Sep 20, 2018

Same problem here :(
It would be great to see a fix as soon as possible.

Thanks!

@Bortxaken
Copy link

I have the exactly the same problem with iOS 12

@Nightsd01
Copy link
Contributor

Nightsd01 commented Sep 20, 2018

I can confirm that this is an issue with the Cordova SDK and Xcode 10. Fortunately there does seem to be a workaround: apache/cordova-ios#407

Essentially Cordova is not bundling the embedded.mobileprovision file when building apps. This will also prevent you from uploading apps to the App Store.

I will be keeping this issue open so that people don't create duplicates

@sveeen
Copy link

sveeen commented Sep 21, 2018

@Nightsd01 this workaround works for me.

Did I understand correctly that I can't deploy the app to apple app store with this workaround?

@Bortxaken
Copy link

In xCode if you go to File -> Workspace Settings you can change the Build System to Legacy Build System and your Push notifications will be received in iOS device.

@Nightsd01
Copy link
Contributor

@Sveen without the workaround, Cordova projects in Xcode 10 will produce apps that don’t include an embedded.mobileprovision file. The App Store will throw an ITMS error when this happens.

@sveeen
Copy link

sveeen commented Sep 21, 2018

@Nightsd01 Yes, I understand.

But my question was, when I use the workaround (which works good), I can publish the app to the App Store or will Apple reject the app?

@Nightsd01
Copy link
Contributor

@sveeen Unless there are other issues with Cordova in Xcode 10 that I am unaware of (and there may very well be), you should be good to go.

In the worst case, with the error we're discussing above, you wouldn't have even been allowed to upload the app, it would not have reached the review process.

@spinninghamster
Copy link

An alternative would be to temporarily go back to Xcode 9.x

You can download it at:
https://developer.apple.com/download/more/

@sveeen
Copy link

sveeen commented Sep 24, 2018

@spinninghamster but only when your iOS device is on ios11. When you are on ios12 Xcode 12 is mandatory.

@joaoduartemariucio
Copy link

In previous versions the push also does not work

@joaoduartemariucio
Copy link

joaoduartemariucio commented Sep 24, 2018

What permissions does OneSignal need?
I already had to tweak the entitlements file once when adding the iOS UserDefault groups permission there is a folder that stands in Platforms> ios> Project _Name with the Entitlements-Debug.plist and Entitlements-Release.plist files that file is not listed in Xcode

@Nightsd01
Copy link
Contributor

Just as a note to folks who start reading this thread, the workaround for this issue is here:
apache/cordova-ios#407

I also want to make it very clear that this is not an issue with our SDK. It is an issue with how Cordova embeds mobile provisioning files in apps in Xcode 10. We cannot fix this issue - only Cordova can. But in the mean time, the workaround above should fix the problem as a temporary solution.

@Nightsd01
Copy link
Contributor

@joaoduartemariucio If you are not able to get push working in previous versions of Xcode you are facing a different issue and should contact the support through our website dashboard

@joaoduartemariucio
Copy link

joaoduartemariucio commented Sep 25, 2018

@Nightsd01 Hello, I'm using Xcode 10. I've seen the mentioned question, it's not clear to me what I should do to get the push to work again using Xcode 10. I understood that there is a new way of building the project in this new version, but I could not identify what should be done. Can you help me?

@Nightsd01
Copy link
Contributor

@LaloCastilla
Copy link
Author

LaloCastilla commented Sep 27, 2018

Have anyone succesfully published your apps to the appstore with that workaround?

Cause now i get an Invalid Signature error from Apple Connect.

@joaoduartemariucio
Copy link

@LaloCastilla I used Xcode 9.4 to publish my application because in Xcode 10 regardless of the device I was running it did not get push

@sveeen
Copy link

sveeen commented Sep 28, 2018

@LaloCastilla
Yes, my app is now online (got mail some minutes ago from apple team).
I used the workaround and Xcode 10. Push is also working.

@joaoduartemariucio
Copy link

joaoduartemariucio commented Sep 28, 2018

@sveeen What alternative solution?

@sveeen
Copy link

sveeen commented Sep 28, 2018

@joaoduartemariucio Take a look here:
apache/cordova-ios#407

@joaoduartemariucio
Copy link

joaoduartemariucio commented Sep 28, 2018

thank you

@torbengabriel
Copy link

torbengabriel commented Oct 26, 2018

In xCode if you go to File -> Workspace Settings you can change the Build System to Legacy Build System and your Push notifications will be received in iOS device.

It works !!!! Thank you very much. I received no notifications since ios 12.

@steptek
Copy link

steptek commented Nov 28, 2018

I am bit confused, we do know that to make your build end correctly on Xcode 10.1 for IOS12.1 you need a workaround (command line or Xcode Menu)... that's ok ..and the buiLd, run on device, and notifications...All good.. but the checking on upload to apple store for review will fail ..>>> "The asset catalog at Assets.car' can't be processed. Rebuild your app, and all included
extensions and frameworks, with the latest GM version of Xcode and resubmit".

So, back and try doing it on new build....the build, run on device all good...but notifications are not working, you see the device on OneSignal dashboard, the device can send and trigger notifications to other playerIds, but did receive nothing.
any insight on that or any tested way because I could be doing something wrong....
do we can manually do something on this embedded.mobileprovision missing to make notifs work, or live with it as is and forget notifs for cordova on Ios12.1

@rgomezp
Copy link
Contributor

rgomezp commented Apr 3, 2019

To prevent Mismatched User errors, upgrade cordova-ios to 5.0.0 (issue should be fixed)

@rgomezp rgomezp closed this as completed Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants