Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #68

Closed
daniel-van-niekerk opened this issue Mar 13, 2019 · 35 comments
Assignees
Labels
Help Wanted Extra attention is needed Low Priority

Comments

@daniel-van-niekerk
Copy link

daniel-van-niekerk commented Mar 13, 2019

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

@rgomezp rgomezp added the Help Wanted Extra attention is needed label Mar 13, 2019
@jkasten2
Copy link
Member

jkasten2 commented Mar 19, 2019

@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.

@ltvan
Copy link

ltvan commented Nov 4, 2019

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));

@om-ha
Copy link

om-ha commented May 7, 2020

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

@polilluminato
Copy link

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.

@valterh4ck3r
Copy link

Same issue

@GusRodrigues86
Copy link

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

@fooshyangsong
Copy link

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?

@mateusfccp
Copy link

I am also having this with 2.6.0 and Flutter 1.20.4.

@KoofNG
Copy link

KoofNG commented Sep 23, 2020

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

@tamirrab
Copy link

Same here
Why this issue is close?

@maxlapides
Copy link

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

@ataknakbulut
Copy link

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

Any update?

@rgomezp rgomezp reopened this Mar 3, 2021
@sync-by-unito sync-by-unito bot changed the title 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 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 Mar 3, 2021
@abbas-25
Copy link

abbas-25 commented Mar 27, 2021

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!!!

@codiantbiztech
Copy link

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

@delCatta
Copy link

Same warning here!

@daoibrahim
Copy link

Same issue here. Any solution?

@walvespit
Copy link

walvespit commented Mar 31, 2021

Same here, any solution ? Flutter 2.0.3

@rgomezp
Copy link
Contributor

rgomezp commented Mar 31, 2021

Howdy,
@Jeasmine is currently investigating this issue.

Thanks for your patience, y'all

@gilthonweapps
Copy link

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

@Jeasmine
Copy link
Contributor

Jeasmine commented May 15, 2021

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 flutter/flutter#82625.

@Jeasmine Jeasmine pinned this issue May 15, 2021
@maxlapides
Copy link

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.

@Jeasmine
Copy link
Contributor

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.

@maxlapides
Copy link

@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.

@stuartmorgan
Copy link

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.

@Jeasmine
Copy link
Contributor

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.

@xirainfotech
Copy link

Any update on this?

@AmbujaAK
Copy link

AmbujaAK commented Oct 2, 2021

Any update??

@LocaTrackGitHub
Copy link

Please note that this method has been officially deprecated and the OneSignal SDK will no longer call it. You should use UNUserNotificationCenter instead
VERBOSE: Initializing the OneSignal Flutter SDK (2.2.0)

@dgilperez
Copy link

Any updates @Jeasmine ?

@foveradm
Copy link

Any news on this subject?

@muhammad-hassan-shakeel
Copy link

muhammad-hassan-shakeel commented Aug 8, 2022

Is there any fix for this? I am using Flutter version 1.20 and I am not receiving notification on iOS

deviceUNUserNotificationCenter delegate received call to -userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: but the completion handler was never called.

@anmolgupta321
Copy link

Flutter version: 3.7.12
onesignal_flutter 3.5.1
I am also getting same warnings
2023-04-27 12:08:58.568676+0530 Runner[17201:195467] 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
Also i am not able to receive any notification on iOS, is this warning is responsible for not receiving any notification.
When i send a push notification to iOS devices, the device is getting registered with 'APNs BAD DEVICE TOKEN' along with this no notification is received on iOS simulator.
Any possible solution for this issue?

@nan-li
Copy link
Contributor

nan-li commented Apr 27, 2023

Hi all, I apologize for the delayed response but we don't have an update on the removal of this warning.

This warning is issued by the OneSignal native iOS SDK due to some detection related to Flutter and can be safely ignored when using our Flutter SDK.

@mHassan20896 Is your error resolved or still happening for you?

@anmolgupta321 This warning can be safely ignored. The 'APNs BAD DEVICE TOKEN' is a separate issue, and may be because you are using an iOS simulator. Push notifications are generally not supported on simulators so it is best to test with a physical device. We will be able to support simulator push notifications in this SDK soon.

@nan-li nan-li closed this as completed Mar 22, 2024
@Selingungor90
Copy link

why issue closed ? I have same problem my flutter version is 3.19.6 onesignal version is onesignal_flutter: ^3.2.7 can you help me ?

@nan-li
Copy link
Contributor

nan-li commented May 9, 2024

Hi @Selingungor90, if you are not calling that method yourself, it can be ignored.
It is a warning that the OneSignal iOS SDK detects in the Flutter codebase. This does not mean Flutter SDK is calling the method, but that it exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Extra attention is needed Low Priority
Projects
None yet
Development

No branches or pull requests