Onesignal-flutter-sdk: WARNING: OneSignal has detected that your application delegate implements a deprecated method (application:didReceiveLocalNotification:). Please note that this method has been officially deprecated and the OneSignal SDK will no longer call it. You should u

Created on 13 Mar 2019  路  26Comments  路  Source: OneSignal/OneSignal-Flutter-SDK

The sdk complains about this.

WARNING: OneSignal has detected that your application delegate implements a deprecated method (application:didReceiveLocalNotification:). Please note that this method has been officially deprecated and the OneSignal SDK will no longer call it. You should use UNUserNotificationCenter instead

I read an issue on the OneSignal IOS sdk github that the sdk needed updating.

My flutter version is 1.2.1 and the onesignal-flutter plugin is ^1.1.0

Help Wanted

Most helpful comment

@rgomezp Can we please re-open this issue? It is clearly an open problem with no resolution.

All 26 comments

@daniel-van-niekerk Thanks for the report. These entries are printed from the OneSignal-iOS-SDK that this Flutter SDK uses.
https://github.com/OneSignal/OneSignal-iOS-SDK/blob/aa59b92fb0b9c0a5343bdd5346282212de80976c/iOS_SDK/OneSignalSDK/Source/OneSignal.m#L673-L681

The warning is noting that another part of your app, either your own native code or another plugin is using the application:didReceiveLocalNotification: method.

I recommend checking the list of plugins in your project and seeing if you have one for local notifications. If so please open an issue with the that plugin developer to have them upgrade to the UNUserNotificationCenter.

onesignal-flutter:2.1.0, I got this issue even in new flutter app (flutter create).

I found this in FlutterPlugin.h (ios/.symlinks/flutter/ios):

/**
 * Calls all plugins registered for `UIApplicationDelegate` callbacks.
 */
- (void)application:(UIApplication*)application
    didReceiveLocalNotification:(UILocalNotification*)notification
    API_DEPRECATED(
        "See -[UIApplicationDelegate application:didReceiveLocalNotification:] deprecation",
        ios(4.0, 10.0));

Can confirm, perhaps the new stable channel flutter build 1.17.0 would fix this from @ltvan comment?

I've got onesignal_flutter: ^2.6.0 and flutter 1.17.5 and I see the warning in the debug console on iOS Simulator.

Same issue

2.6.0 and flutter 1.20, same issue, with a new project

Same issue, is there's any solution for this? I had implement UNUserNotificationCenter but still getting this warning. Do I need any configure in Xcode app delegate?

I am also having this with 2.6.0 and Flutter 1.20.4.

Same issue. Using Flutter v1.20.4 and oneSignal v2.6.1

Same here
Why this issue is close?

@rgomezp Can we please re-open this issue? It is clearly an open problem with no resolution.

@rgomezp Can we please re-open this issue? It is clearly an open problem with no resolution.

Any update?

Having the same issue, commenting because it seems not being addressed.

I am on Flutter 1.22 and OneSignal ^2.6.3

I am not able to subscribe users from ios to one signal, however, the android works great.

Moreover, this seems to be a onesignal issue primarily as I can reproduce the same issue on a newly created project with no other dependencies. Please address this asap!!!

same problem on flutter 1.22, onesignal 2.6.3
Not able to get rid of it since two days

Same warning here!

Same issue here. Any solution?

Same here, any solution ? Flutter 2.0.3

Howdy,
@Jeasmine is currently investigating this issue.

Thanks for your patience, y'all

Hi, any update on that one? The warning is still happening with version 3.0.0-beta2

Hey all! This is a problem with flutter integration. From OneSignal, we detect this method
- (void)application:(UIApplication*)application didReceiveLocalNotification:(UILocalNotification*)notification
being implemented by https://github.com/flutter/engine/blob/master/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm.
Even if you guys are not using it until Flutter side removes it, OneSignal will warn it.
We recommend not to use this method since it will end on making OneSignal not work correctly. We already asked the Flutter community to know when they are going to remove this method of support. Keep track of https://github.com/flutter/flutter/issues/82625.

Based on this response from @stuartmorgan, this is an issue in this plugin, not Flutter:

Since application:didReceiveLocalNotification is a method not recommended by the native side

Starting in iOS 10.

remove support on newer flutter versions

Flutter supports back to iOS 8. The replacement doesn't exist until iOS 10, so it cannot be removed without breaking everyone's apps on iOS 8 and iOS 9.

If I'm reading the linked issue correctly, a plugin is unconditionally logging error messages if an application implements a delegate method even though doing so is:

  • still necessary on iOS 8 and 9
  • harmless in later versions.

That's a bug in the plugin, not Flutter.

Based on this response from @stuartmorgan, this is an issue in this plugin, not Flutter:

Since application:didReceiveLocalNotification is a method not recommended by the native side

Starting in iOS 10.

remove support on newer flutter versions

Flutter supports back to iOS 8. The replacement doesn't exist until iOS 10, so it cannot be removed without breaking everyone's apps on iOS 8 and iOS 9.
If I'm reading the linked issue correctly, a plugin is unconditionally logging error messages if an application implements a delegate method even though doing so is:

  • still necessary on iOS 8 and 9
  • harmless in later versions.

That's a bug in the plugin, not Flutter.

Yeah, the problem is that OneSignal detects when the - (void)application:(UIApplication*)application didReceiveLocalNotification:(UILocalNotification*)notification method is being implemented. Since the AppDelegate used by Flutter implements it, please check under https://github.com/flutter/engine/blob/master/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm, OneSignal returns the WARNING that you are seeing. The main intention is to alert the user not to use the deprecated method. Until Flutter internally supports it, OneSignal will keep launching the Warning. I hope this clarifies the problem.

@Jeasmine I'm sorry but I have to insist that this is an open issue in this plugin that can and should be resolved by OneSignal.

This plugin should NOT print this warning to the console. Instead, it should detect which version of iOS the app is running on, handle this method on iOS 8 and 9, and handle it properly with the new API for newer versions of iOS.

Until Flutter internally supports it

What is the "it" that you believe Flutter does not support here?

I don't understand why you are trying to frame this as a bug in Flutter.

Hey @stuartmorgan, Sorry for the misunderstanding, I just wanted to explain what the log is trying to say. It is not a bug under Flutter, but because they support and implement the method - (void)application:(UIApplication*)application didReceiveLocalNotification:(UILocalNotification*)notification OneSignal detects it and prints the Warning even if your app is not using it. We are currently defining how to solve this in a more generic way to impact all wrappers. In the meantime, we keep encouraging not to use that method.

Any update on this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rgbinnovation picture rgbinnovation  路  7Comments

TarekkMA picture TarekkMA  路  10Comments

Allan-Nava picture Allan-Nava  路  4Comments

xXUlquiScXx picture xXUlquiScXx  路  4Comments

bhoominn picture bhoominn  路  3Comments