pushy / pushy-flutter

The official Pushy SDK for Flutter apps.
Apache License 2.0
21 stars 19 forks source link

Token is not generating Pushy in IOS #62

Closed Wasim6749 closed 6 months ago

Wasim6749 commented 6 months ago

Token is not generating in IOS Devices and when i kill the application and run it again it is generating a token in IOS Devices such as Iphone XR and other devices

https://github.com/pushy/pushy-flutter/assets/155939741/3a247af1-6d08-45c2-a7cd-3541fd327945

pushy commented 6 months ago

Hi @Wasim6749, Thanks for reaching out. We'd be glad to assist.

The error "Failed to verify OTP: INVALID P-TOKEN" is not related to Pushy.

It appears to be that your OTP (one-time-password) that you are entering to log into the app which you are testing "844444" is incorrect. You should ensure that you are entering the one-time-code which is sent to you via SMS when clicking the arrow next to the phone number field.

Once you are able to correct that, most likely, the app will then call Pushy.register() and the device will be assigned a Pushy device token.

Wasim6749 commented 6 months ago

when the app launches it should make a pushy token which is then passed on to the api but in that the token is null thats why it is showing an error and when i kill the application in background and then open it again it is providing token and it is working properly it happens for only the first time. I have followed every step as per the documentation please look into it and provide me a solution

pushy commented 6 months ago

Hi @Wasim6749, If the token returned is null, it means that an exception was thrown by Pushy.register().

Please let us know what is the exception message thrown by the invocation of Pushy.register():

String deviceToken = await Pushy.register();