OneSignal-Flutter-SDK icon indicating copy to clipboard operation
OneSignal-Flutter-SDK copied to clipboard

[question]: [Flutter] - .apk file cannot be registered on OneSignal

Open PhamChiNang151020 opened this issue 2 years ago • 6 comments

How can we help?

I go into debug mode, my console still shows "Subscriptions".

But when I build the .apk. Then the OneSignal dashboard is not showing and find "Subscriptions" on. I have tried deleting and reinstalling but still not working.

Information:

[√] Flutter (Channel stable, 3.7.7, on Microsoft Windows [Version
    10.0.19045.3324], locale en-US)
    • Flutter version 3.7.7 on channel stable at D:\Enviroments\flutter       
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2ad6cd72c0 (6 months ago), 2023-03-08 09:41:59 -0800 
    • Engine revision 1837b5be5f
    • Dart version 2.19.4
    • DevTools version 2.20.1

In pubspec.yaml :

onesignal_flutter: ^5.0.0

In main.dart

  OneSignal.initialize(keyOneSignalNotifier.value);
  OneSignal.Notifications.requestPermission(true);

image

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

PhamChiNang151020 avatar Aug 28 '23 09:08 PhamChiNang151020

Same problem... this error only in release mode image

wesleytoshio avatar Aug 28 '23 16:08 wesleytoshio

Hi @wesleytoshio I face same problem in release mode Have you find any solution?

pnilkanth12 avatar Aug 29 '23 09:08 pnilkanth12

same here in release

andredealmei avatar Aug 31 '23 14:08 andredealmei

my solution is to go back to version 3.5.1, allworks

wesleytoshio avatar Aug 31 '23 15:08 wesleytoshio

Add the permission line above the initialize line and put await at the beginning. Run initialize if user allows, otherwise don't run. If you still get the same error, request notification permission using the Permission package instead of Onesignal notification permission.

Aksoyhlc avatar Sep 06 '23 08:09 Aksoyhlc

I have the same problem, is there any update ?

wahyu-handayani avatar Nov 08 '23 06:11 wahyu-handayani