onmyway133 / PushNotifications

🐉 A macOS, Linux, Windows app to test push notifications on iOS and Android
https://onmyway133.com
Other
2.26k stars 176 forks source link

Notifications aren't sent to Production environment while using .p8 token (IOS). Error: "Failed: BadDeviceToken" #3

Closed Ariandr closed 6 years ago

Ariandr commented 6 years ago

It seems there is a problem when I switch to the Production environment when I use .p8 token. I get the error: "Failed: BadDeviceToken". But device token is right for Production and I don't get that error, when I use my own server to send the same notification with all the same data (Key Id, Team Id, ...). So, it seems the app doesn't switch environments. Because while I was using Sandbox, everything worked ok. screenshot at nov 30 18-13-09

yajiex commented 6 years ago

I also hit this issue. I haven't started to look at the code of this repo, my workaround is to setup a server which talks with apns by myself.

onmyway133 commented 6 years ago

@Ariandr @yajiex Hi, thanks for using my app. I just fixed it, you can now check https://github.com/onmyway133/PushNotifications/releases/tag/1.2.1

Ariandr commented 6 years ago

@onmyway133 Thanks a lot!

Ariandr commented 6 years ago

@onmyway133 There is another problem now. When I run the app, it's just blank. screen shot 2018-01-10 at 13 10 38

onmyway133 commented 6 years ago

@Ariandr Hi, there was problem with electron-packager so the packaged app is not correct. I will have a look

Ariandr commented 6 years ago

@onmyway133 great, thanks!

onmyway133 commented 6 years ago

@Ariandr I opened the issue here https://github.com/electron-userland/electron-packager/issues/787, hopefully get an answer then I can continue making new release

Ariandr commented 6 years ago

@onmyway133 hi, thank you!

onmyway133 commented 6 years ago

@Ariandr @yajiex Hi, can you try https://github.com/onmyway133/PushNotifications/releases/tag/1.2.3

jaumard commented 5 years ago

With 1.3.0 I'm getting Failed: BadDeviceToken, but I get the token directly from the device getToken method...

Ariandr commented 5 years ago

@jaumard Hi, you probably use a wrong token. You should use the token received from this method after you send a request to register for Push Notifications.

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    let   tokenString = deviceToken.reduce("", {$0 + String(format: "%02X",    $1)})
    print("deviceToken: \(tokenString)")
}