urbanairship / airship-flutter

Flutter integration
Other
17 stars 17 forks source link

Airship.push.iOS.resetBadge is not calling the correct method name #182

Closed b-nugent closed 1 year ago

b-nugent commented 1 year ago

❗For how-to inquiries involving Airship functionality or use cases, please contact (support)[https://support.airship.com/].

Preliminary Info

What Airship dependencies are you using?

airship_flutter v7.0.0

What are the versions of any relevant development tools you are using?

Flutter v3.7.11, Dart v2.19.6

Report

What unexpected behavior are you seeing?

When attempting to call Airship.push.iOS.resetBadge the following error is thrown:

PlatformException(UNAVAILABLE, Unknown method: push#ios#resetBadgeNumber, null, null)
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:315:18)
<asynchronous suspension>
#2      IOSPush.resetBadge (package:airship_flutter/src/airship_push.dart:282:12)
<asynchronous suspension>

After looking in SwiftAirshipPlugin.swift I'm not seeing an associated push#ios#resetBadgeNumber among the other cases and I'm thinking it might've been removed accidentally. In v6.3.0, the version we were formerly using, this seemed to be calling out to resetBadge in Push.swift.

What is the expected behavior?

Calling Airship.push.iOS.resetBadge calls the associated push#ios#resetBadgeNumber method to clear the badge on the app icon in iOS

What are the steps to reproduce the unexpected behavior?

Calling Airship.push.iOS.resetBadge in any way

Do you have logging for the issue?

I do not currently

rlepinski commented 1 year ago

It actually looks like its not wired up at all 😞

We will get a patch release out tomorrow. Thanks for the report!

rlepinski commented 1 year ago

Fixed in 7.1.0