pushy / pushy-flutter

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

await Pushy.register() #65

Closed LucasLau00 closed 4 months ago

LucasLau00 commented 5 months ago

For the main.dart file, I have it copied from the pub.dev at the example all code is working fine until the part which calls the await Pushy.register(), it does not proceed to do anything it just gets stuck. Nothing is returned on my side of console. I have also added loggign statements before and after it, the before one is called and the one after is not executed which means that it is stuck at this part.

LucasLau00 commented 5 months ago

Just testing with the https://github.com/pushy/pushy-demo-flutter/tree/master and still not working on Android studio Iguana 2023.2.1 Patch 1 XCODE 15.3 IOS Simulator 17.4 Flutter SDK 3.19.3 MACOS: Sonoma Pushy tested with both .18 and .17 both hangs and didn't return anything. It is using your code only so no other services are used for now. Disabled swizzling as well. Have also set my own bundle identifier and selected my own development team in Xcode.

pushy commented 5 months ago

Hi @LucasLau00, Thanks for reporting this issue. We'd be glad to assist.

The issue most likely stems from the use of the iOS Simulator, can you please try with a physical iOS device to see whether you can reproduce the issue?

Also, what do you mean by "disabled swizzling"? Please do not disable swizzling, it should not be disabled unless you need to include other APNs-dependent SDKs such as Firebase Auth, Firebase Messaging, OneSignal, etc. Disabling swizzling will actually lead to a hanging Pushy.register() call.

LucasLau00 commented 5 months ago

Yes tested on my physical device with the demo. Device is ios17.3.1 iphone15 pro. Connected via type c to c and executed with android studio.

LucasLau00 commented 5 months ago

Hi @LucasLau00,

Thanks for reporting this issue. We'd be glad to assist.

The issue most likely stems from the use of the iOS Simulator, can you please try with a physical iOS device to see whether you can reproduce the issue?

Also, what do you mean by "disabled swizzling"? Please do not disable swizzling, it should not be disabled unless you need to include other APNs-dependent SDKs such as Firebase Auth, Firebase Messaging, OneSignal, etc. Disabling swizzling will actually lead to a hanging Pushy.register() call.

Thanks for the reply will remove it and give it a try and let you know the outcome thank you.

pushy commented 5 months ago

Hi @LucasLau00, Please do not remove the invocation of pushy.toggleMethodSwizzling(false), please instead replace it with the following:

pushy.toggleMethodSwizzling(true);
LucasLau00 commented 5 months ago

After doing pushy.toggleMethodSwizzling(true); it managed to work on real device but still not working on IOS Simulators. Thanks for the advice, if there are any ways simulators can be made to work it would be great thanks in advance.

pushy commented 5 months ago

Hi @LucasLau00, Are you using an M1, M2, or T2 Mac?

As per Apple specifications, only Apple Silicon M1, M2, and T2 Macs can register for and receive push notifications via APNs in the iOS Simulator.

pushy commented 4 months ago

Closing due to lack of response, please feel free to let us know if you're still facing this issue.