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

OneSignal Flutter SDK Version 3 - Beta!

Open Jeasmine opened this issue 5 years ago • 43 comments

Hello everyone! The Flutter major release version 3 is now in Beta!

This version includes many exciting changes including an overall simplification of the API as well as many of the underlying native improvements and bug fixes.

Some key changes already in Beta:

  • Better notification control while app is in foreground
  • Part of OneSignal initialization is now done for you automatically. Simply set the app id to complete the process.

Why you should start migrating now

Most importantly, we want to give you the opportunity to voice your opinion and provide feedback so that we can make changes as needed to better suit your implementation.

Furthermore, it is always beneficial to get a head start on migrating your implementation to ensure a smooth transition. As we continue improving OneSignal, being fully migrated to the latest version of the SDK will help minimize potential issues and ensure you can focus on providing value to your customers, improving your business, and creating a delightful messaging experience.

To begin migrating your app to version 3, read our migration guide here. Regarding this guide, please let us know if anything could be clarified or communicated better.

Releases Page

We are looking forward to hearing from you.

Enjoy!

Jeasmine avatar Mar 03 '21 14:03 Jeasmine

Is Null Safety included ?

pr-1 avatar Mar 04 '21 04:03 pr-1

Is Null Safety included ?

dart pub outdated --mode=null-safety

says no

:-(

laurent-humbert avatar Mar 04 '21 14:03 laurent-humbert

After following the migration guide, I am getting the following

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    OneSignalNotificationServiceExtension/NotificationService.m:1:9: fatal error: 'OneSignal/OneSignal.h' file not found
    #import <OneSignal/OneSignal.h>
            ^~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
Could not build the application for the simulator.

Is there an updated version of NotificationService.m to use?

EDIT: I believe I was just missing pod 'OneSignal', '>= 3.0.0', '< 4.0' from the Runner target in my Podfile, I think it's working now. Will report back any issues if I encounter them.

johnsheehan avatar Mar 09 '21 20:03 johnsheehan

@Jeasmine OneSignal.shared.setNotificationOpenedHandler((OSNotificationOpenedResult result) {} is not triggered. It works in version 2.6.3 though.

superakabo avatar Mar 18 '21 08:03 superakabo

When I click on the push notification, setNotificationOpenedHandler should be called

OneSignal.shared.setNotificationOpenedHandler((OSNotificationOpenedResult result) {
    try {
      ReceiveNotification.instance.addPushData(result.notification);
    }
    catch(e) {
      print('e : ' + e.toString());
    }
  });

Unfortunately, this does not happen and I get the error below

I/WM-WorkerWrapper( 7882): Worker result FAILURE for Work [ id=eacb68a2-f7f4-4dd6-9be0-785162b87877, tags={ com.onesignal.OSNotificationRestoreWorkManager$NotificationRestoreWorker } ]
W/OneSignal( 7882): FusedLocationApi.requestLocationUpdates failed!
W/OneSignal( 7882): java.lang.NullPointerException: Calling thread must be a prepared Looper thread.
W/OneSignal( 7882): 	at com.google.android.gms.common.internal.Preconditions.checkNotNull(Unknown Source)
W/OneSignal( 7882): 	at com.google.android.gms.internal.location.zzq.requestLocationUpdates(Unknown Source)
W/OneSignal( 7882): 	at com.onesignal.GMSLocationController$FusedLocationApiWrapper.requestLocationUpdates(GMSLocationController.java:198)
W/OneSignal( 7882): 	at com.onesignal.GMSLocationController$LocationUpdateListener.init(GMSLocationController.java:181)
W/OneSignal( 7882): 	at com.onesignal.GMSLocationController$LocationUpdateListener.<init>(GMSLocationController.java:165)
W/OneSignal( 7882): 	at com.onesignal.GMSLocationController.onFocusChange(GMSLocationController.java:117)
W/OneSignal( 7882): 	at com.onesignal.LocationController.onFocusChange(LocationController.java:326)
W/OneSignal( 7882): 	at com.onesignal.OneSignal.onAppLostFocus(OneSignal.java:1203)
W/OneSignal( 7882): 	at com.onesignal.ActivityLifecycleHandler$AppFocusRunnable.run(ActivityLifecycleHandler.java:282)
W/OneSignal( 7882): 	at java.lang.Thread.run(Thread.java:762)

MeAtPros avatar Mar 26 '21 13:03 MeAtPros

Same issues was fixed on OneSignal Android SDK - notifications omitted in OSRemoteNotificationReceivedHandler and from disabled channels being restored and shown as silent notifications. PR #1289, Issue #1265

MeAtPros avatar Mar 26 '21 22:03 MeAtPros

@Jeasmine OneSignal.shared.setNotificationOpenedHandler((OSNotificationOpenedResult result) {} is not triggered. It works in version 2.6.3 though.

Thanks for the feedback. Is it not working for both Android and iOS?

Jeasmine avatar Mar 30 '21 19:03 Jeasmine

@Jeasmine Only Android. unfortunately this bug is blocking me from releasing an application update. Please, solve it as soon as possible

MeAtPros avatar Mar 30 '21 19:03 MeAtPros

@Jeasmine OneSignal.shared.setNotificationOpenedHandler((OSNotificationOpenedResult result) {} is not triggered. It works in version 2.6.3 though.

Thanks for the feedback. Is it not working for both Android and iOS?

Yes, it does not work for both Android and iOS.

superakabo avatar Mar 31 '21 07:03 superakabo

@Jeasmine Any update with beta-1 ? I need a fix for this problem fairly quickly as it prevents me from the released versions. Unfortunately, I can't revert my project to the previous version.

MeAtPros avatar Apr 02 '21 18:04 MeAtPros

@MeAtPros, we are working on the new release, hopefully, will be out this week

Jeasmine avatar Apr 05 '21 15:04 Jeasmine

@MeAtPros there is this PR up https://github.com/OneSignal/OneSignal-Flutter-SDK/pull/375, but unfortunately, the scenario when the app is swiped away the open handler is not being called, there is a problem with flutter integration still trying to figure it out.

Jeasmine avatar Apr 05 '21 22:04 Jeasmine

@Jeasmine I'm looking for this release too, the beta release solves a critical problem in iOS that in version 2 I can't suppress default launch url behavior to only handle inside my app, and the version 3 helped me to do this :)

edsonboldrini avatar Apr 05 '21 23:04 edsonboldrini

Same having issues with launch url, we're unable to deep link into our app with the launch_url parameter

marclester-tang avatar Apr 07 '21 01:04 marclester-tang

After migrating we are having the problem in #374 which is preventing us from distributing the app.

phcs971 avatar Apr 07 '21 13:04 phcs971

I am having the same problem as #374. I tried reverting OneSignal to 2.6.3 but I still get the same errors...

nickscamara avatar Apr 07 '21 19:04 nickscamara

@Jeasmine @mikechoch @mpillar Can you set a date when a proper release of the update can be expected?

MeAtPros avatar Apr 12 '21 18:04 MeAtPros

Beta 2 has been released! https://github.com/OneSignal/OneSignal-Flutter-SDK/releases/tag/3.0.0-beta2

Jeasmine avatar Apr 14 '21 22:04 Jeasmine

Hi, the issue with the external user id being randomly set when using setExternalUserId is still there.

gilthonweapps avatar Apr 15 '21 19:04 gilthonweapps

@gilthonweapps, Could you open a GitHub issue with the steps to reproduce and the description, or could you point me out to the issue if there is already one created? Thanks!

Jeasmine avatar Apr 16 '21 19:04 Jeasmine