Code Monkey home page Code Monkey logo

airship-flutter's Introduction

image

About

urbanairship is a Ruby library for using the Airship REST API for push notifications, message center messages, email, and SMS.

Requirements

We officially support the following Ruby versions:

2.6.7
2.7.2

Newer 2.x versions should work as well.

Functionality

Version 8.0 is a major upgrade, as we have changed the tested/supported versions of Ruby. A more detailed list of changes can be found in the CHANGELOG.

Questions

The best place to ask questions or report a problem is our support site: http://support.airship.com/

Installation

If you have the bundler gem (if not you can get it with $ gem install bundler) add this line to your application's Gemfile:

>>> $ gem 'urbanairship'

And then execute:

>>> $ bundle

OR install it yourself as:

>>> $ gem install urbanairship

Configuration

In your app initialization, you can do something like the following:

require 'urbanairship'

Urbanairship.configure do |config|
  config.server = 'api.asnapieu.com'
  config.oauth_server = 'oauth2.asnapieu.com'
  config.log_path = '/path/to/your/logfile'
  config.log_level = Logger::WARN
  config.timeout = 60
end

If you want to use a custom logger (e.g Rails.logger), you can do:

require 'urbanairship'

Urbanairship.configure do |config|
  config.custom_logger = Rails.logger
  config.log_level = Logger::WARN
end

Available Configurations

  • log_path: Allows you to define the folder where the log file will be created (the default is nil).
  • log_level: Allows you to define the log level and only messages at that level or higher will be printed (the default is INFO).
  • server: Allows you to define the Airship server you want to use ("api.asnapieu.com" for EU or "api.asnapius.com" for US)
  • oauth_server Allows you to define the Airship Oauth server you want to use ("oauth2.asnapieu.com" for EU or "oauth2.asnapius.com" for US)
  • timeout: Allows you to define the request timeout in seconds (the default is 5).

Usage

Once the gem has been installed you can start sending pushes! See the full documentation, api examples, as well as the Airship API Documentation for more information.

Broadcast to All Devices

require 'urbanairship'

UA = Urbanairship

airship = UA::Client.new(key:'application_key', secret:'master_secret')
p = airship.create_push
p.audience = UA.all
p.notification = UA.notification(alert: 'Hello')
p.device_types = UA.device_types(['ios','android'])
p.send_push

Simple Tag Push

require 'urbanairship'

UA = Urbanairship

airship = UA::Client.new(key:'application_key', secret:'master_secret')
p = airship.create_push
p.audience = UA.tag('some_tag')
p.notification = UA.notification(alert: 'Hello')
p.device_types = UA.device_types(['ios','android'])
p.send_push

Specify the Airship server used to make your requests

By default, the request will be sent to the 'api.asnapius.com' server:

require 'urbanairship'

Urbanairship::Client.new(key:'application_key', secret:'master_secret')

You can change the server globally in the Urbanairship configuration:

require 'urbanairship'

Urbanairship.configure do |config|
  config.server = 'api.asnapieu.com'
end

Urbanairship::Client.new(key:'application_key', secret:'master_secret')
# request will be sent to the 'api.asnapieu.com' server

Finally, you can change the targeted server on a request basis:

require 'urbanairship'

Urbanairship.configure do |config|
  config.server = 'api.asnapieu.com'
end

Urbanairship::Client.new(key:'application_key', secret:'master_secret', server: 'api.asnapius.com')
# The Urbanairship configuration is overridden by the client and the
# request will be sent to the 'api.asnapius.com' server

Using Bearer Token Auth

require 'urbanairship'

UA = Urbanairship
airship = UA::Client.new(key:'application_key', token:'token')
# Then continue as you would otherwise

Note: If you include a token in your instantiation, the request will use bearer token auth. Bearer token auth is required for some endpoints, but not supported by others. Please check the Airship docs site to see where it is supported.

Using Oauth

require 'urbanairship'

UA = Urbanairship
app_key = 'application_key'

oauth = UA::Oauth.new(
  client_id: 'client_id',
  key: app_key,
  assertion_private_key: 'your_private_key',
  scopes: ['psh', 'chn'], # Optional
  ip_addresses: ['23.74.131.15/22'], # Optional
  oauth_server: 'api.asnapieu.com' # Optional
)
airship = UA::Client.new(key: app_key, oauth: oauth)
# Then continue as you would otherwise

Note: You can not use both Oauth and bearer token auth at the same time. Oauth also cannot be used with the older 'api.urbanairship.com' and 'api.airship.eu' base URLs. Lastly there are some endpoints in which Oauth is not supported. Please check the Airship docs site to see where it is supported.

Contributing

  1. Fork it ( https://github.com/urbanairship/ruby-library )
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes git commit -am 'Add some feature'
  4. Push to the branch git push origin my-new-feature
  5. Create a new Pull Request
  6. Sign Airship's contribution agreement.

7. Reach out to our support team at https://support.airship.com to let us know about your PR and your urgency level.

Note: Changes will not be approved and merged without a signed contribution agreement.

Development

After checking out the repo, ensure you have bundler installed ($ gem install bundler) run:

>>> $ bin/setup

to install dependencies. Then, run:

>>> $ bin/console

for an interactive prompt that will allow you to experiment.

OR you can build a local gem to play with:

>>> $ gem build urbanairship.gemspec
>>> $ gem install ./urbanairship-<VERSION>.gem

Having a local build will give you better logging if you are running into issues, but be careful to make sure to use our released public gem in Production.

airship-flutter's People

Contributors

apekka avatar bmatthai avatar brianbatchelder avatar crow avatar cs-nuuk avatar jyaganeh avatar khmmouna avatar oristanovic avatar rlepinski avatar shadracknx avatar ulrico972 avatar vincevargadev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airship-flutter's Issues

Fatal error: TakeOff must be called before accessing Airship

Preliminary Info

What Airship dependencies are you using?

airship_flutter: ^5.0.1

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

Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 18116933e7 (4 weeks ago) • 2021-10-15 10:46:35 -0700
Engine • revision d3ea636dc5
Tools • Dart 2.14.4

Xcode Version 13.1 (13A1030d)

Report

What unexpected behavior are you seeing?

Compiling Flutter project using latest Xcode and latest airship_flutter dependency, generates a fatal error during app launch.

What is the expected behavior?

App should start

What are the steps to reproduce the unexpected behavior?

Update airship_flutter and build project with the most recent Xcode

Do you have logging for the issue?

2021-11-12 14:50:06.092063+0100 Runner[1027:180872] Could not load the “LaunchImage” image referenced from a nib in the bundle with identifier “com.chiesi.bt4uenterprise” AirshipKit/Airship.swift:128: Fatal error: TakeOff must be called before accessing Airship. 2021-11-12 14:50:06.112434+0100 Runner[1027:180872] AirshipKit/Airship.swift:128: Fatal error: TakeOff must be called before accessing Airship.

Cannot create appbundle on release mode with flutter 3.0.0

airship_flutter: 5.2.0
flutter: 3.0.0
dart: >=2.17.0 <3.0.0
android sdk: 16.3.0

After the flutter 3.0.0 release, I tried to create appBundle on release mode on the Android side and I could not.

Error:

3 warnings
e: /Users/kaantahakoken/.pub-cache/hosted/pub.dartlang.org/airship_flutter-5.2.0/android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt: (50, 1): Class 'InboxMessageViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: /Users/kaantahakoken/.pub-cache/hosted/pub.dartlang.org/airship_flutter-5.2.0/android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt: (51, 5): 'create' overrides nothing

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':airship_flutter:compileReleaseKotlin'.
> Compilation error. See log for more details

Then I update the airship_flutter to the latest,5.5.0 with android SDK 16.4.0.
It gave the same error as well.

PS: It works when I was using:
airship_flutter: 5.2.0
flutter: 2.10.3
dart: >=2.16.0 <3.0.0
android sdk: 16.3.0

Android not getting pushes- Ios does.

Preliminary Info

iOS channels registered successfully, and using the airship test push and send to specific device works.
Android channels are registered successfully, but device does not receive pushes.
Using RAW FCM and google APIs, device is able to receive push.
Airship console reports 0 pushes sent.

What Airship dependencies are you using?

airship_flutter: ^3.0.2

Report

What unexpected behavior are you seeing?

Pushes from airship console never reach intended audience- no logs.

What is the expected behavior?

Push received and shown in notification bar

What are the steps to reproduce the unexpected behavior?

  1. Configure a airship project with flutter sdk 3.0.2
  2. Register FCM from google firebase in airship project android channel
  3. Install app, push to newly configured channel id

Do you have logging for the issue?

No logs are outputted that show any adverse issues.

Airship setUserNotificationsEnabled malfunction on Android

Preliminary Info

What Airship dependencies are you using?

airship_flutter: ^6.3.2

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

Physical Android device Galaxy S21 , Android v. 13
Flutter 3.10.5

Report

What unexpected behavior are you seeing?

I am using Airship in Flutter for my iOS and Android Apps. According to Airship Documentation for Flutter setting Airship.setUserNotificationsEnabled(true) should show a prompt so user can decide if they want push notifications or not. It happens both on iOS and on Android. The difference is that Android always sets it to 'true', event if the user chose 'Dont`t allow push notifications'.

What is the expected behavior?

If a user choose 'Don`t allow notifications', the callback variable should be 'false' on Android.

What are the steps to reproduce the unexpected behavior?

Airship.setUserNotificationsEnabled(true).then((status) => {

 // status here is always 'true' on Android
 // if I open App settings, it is correctly false
 // but I need to implement some features that relying on the status variable
 // in iOS, the status is always correct, so it can be 'true' or 'false' according to users choice

}

Do you have logging for the issue?

No

Cant use latest flutter stable or an airship version below 3.1.0 because of XCode 12

Preliminary Info

What Airship dependencies are you using?

3.1.0

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

[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.6 19G2021, locale en-DE)
• Flutter version 1.20.3
• Framework revision 216dee60c0 (3 weeks ago), 2020-09-01 12:24:47 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
• Xcode 12.0, Build version 12A7209
• CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

What unexpected behavior are you seeing?

Can't built for iOS with a version below airship_flutter: 3.1.0. But version 3.1.0 depends on intl 0.15.7, but this intl version is not usable if you are using flutter 1.20.3 or higher (maybe even lower, didn't check it).

What is the expected behavior?

Adjust the intl dependency so that it can be used with latest flutter stable.

What are the steps to reproduce the unexpected behavior?

Use the configuration from flutter doctor and try to build a flutter app with intl and airship.

AirshipChannelCreatedEvent not found

Good Evening, i'm trying to integrate Airship into a project to send push notifications. On the Android, works fine with the correct dependencies, but on iOS, when i do the 'pod install' and try to run the project, it says that it can't found the class 'AirshipChannelCreatedEvent'.

Logs:

Xcode's output:

=== BUILD TARGET airship OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/viniciusfragellisenff/Documents/flutter/.pub-cache/git/airship-flutter-7ca75191af62a4c577df5ce064a8b6f4151825e7/ios/Classes/Events/AirshipChannelUpdatedEvent.swift:3:36: error: use of undeclared type 'AirshipChannelCreatedEvent'
class AirshipChannelUpdatedEvent : AirshipChannelCreatedEvent {
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/viniciusfragellisenff/Documents/flutter/.pub-cache/git/airship-flutter-7ca75191af62a4c577df5ce064a8b6f4151825e7/ios/Classes/Events/AirshipChannelUpdatedEvent.swift:4:18: error: property does not override any property from its superclass
override var eventType: AirshipEventType {
~~~~~~~~ ^
/Users/viniciusfragellisenff/Documents/flutter/.pub-cache/git/airship-flutter-7ca75191af62a4c577df5ce064a8b6f4151825e7/ios/Classes/Events/AirshipChannelUpdatedEvent.swift:6:20: error: type 'AirshipEventType' has no member 'ChannelUpdated'
return AirshipEventType.ChannelUpdated

Pods that it install:

Analyzing dependencies
Fetching podspec for Flutter from .symlinks/flutter/ios
Fetching podspec for airship from .symlinks/plugins/airship/ios
Downloading dependencies
Using Flutter (1.0.0)
Using UrbanAirship-iOS-AppExtensions (10.2.2)
Using UrbanAirship-iOS-SDK (10.2.2)
Using airship (0.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 3 dependencies from the Podfile and 4 total pods installed.

Best regards,

Null Safety

Hi, can we get a Null Safety version of this flutter package? I can take a stab at an initial PR. let me know. Thanks!

Add Flutter Module to a Native App

Hi, I'm doing this for a app, so I can migrate few modules of my app using flutter.
https://flutter.dev/docs/development/add-to-app

But the airship-flutter plugin doesn't work as a module because it was done with the old flutter plugin system and it should be migrated:
https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration

This is the error, after create a Flutter Module with the airship-flutter plugin:

The plugin airship_flutter is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment. It may have undefined behaviors when Flutter is integrated into an existing app as a module. The plugin can be updated to the v2 Android Plugin APIs by following https://flutter.dev/go/android-plugin-migration.

I think this is a easy fix, looking forward to see it, thank you.

Cannot handle notification like Firebase "myBackgroundMessageHandler" in Killed state.

❗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?

5.1.1

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

Android studio

Report

What unexpected behavior are you seeing?

We could handle almost every scenario using Airship.Except Handling notification in killed state. We had implemented firebase for Notification, it has a function i.e "myBackgroundMessageHandler" which can handle and update a notification even in the killed state. I couldn't find any function or handler in Airship which can handle during killed state.
Right now when we receive a notification and we click on it and enter inside the app. "Airship.onPushReceived
.listen((event)" is been getting after we enter inside the App.

What is the expected behavior?

During killed state we want to have our own custom notification(Like a call feature). We want "Airship.onPushReceived
.listen((event)" to be called even in killed state. (Specifically for android)

Please help us with this issue or any help so that we can handle this behaviour.

What are the steps to reproduce the unexpected behavior?

By sending notification in android app during killed state. Check if there is any way to know we have receive a push during killed state.

Do you have logging for the issue?

Remove jCenter

Preliminary Info

What Airship dependencies are you using?

airship_flutter: 5.1.0

Report

What unexpected behavior are you seeing?

jCenter is still listed as a source in the build.gradle

What is the expected behavior?

jCenter gets removed because it shuts down on February 1, 2022. It should be replaced with mavenCentral().

What are the steps to reproduce the unexpected behavior?

Look at these lines: https://github.com/urbanairship/airship-flutter/blob/main/android/build.gradle#L9-L25

Do you have logging for the issue?

No

Unable to listen to events push notification events when app is not launched

Preliminary Info

What Airship dependencies are you using?

Flutter SDK 4.2.0

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

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.3.1 20E241 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.2.3)
[✓] Connected device (2 available)

Report

What unexpected behavior are you seeing?

An app that is not launched cannot react to push notifications with the Airship SDK. For example, configuring a listener at the app level such as Airship.onNotificationResponse.listen((event) => ...); which extracts some data from the push payload, and navigates to a route with that data, does not allow the user to navigate to that route when the app is not launched. If the app is foregrounded or backgrounded, it works as expected. There are no listeners for the Airship SDK for dealing with a not launched scenario like Firebase has for their Cloud Messaging.

What is the expected behavior?

A not launched app is able to navigate to a specific route after configuring the Airship listener. Minimally, there should be another listener available in the SDK that covers this scenario.

Initialise Airship sdk at runtime with secret keys from remote source.

Is it possible to fetch "productionAppKey" "productionAppSecret" from remote source at runtime and do initialisation?
Or this data has to be part of "airshipconfig.properties" and "AirshipConfig.plist" files respectively for Android and iOS?

What Airship dependencies are you using?

4.4.0

What unexpected behavior are you seeing?

There are no methods exposed for set configuration at runtime

InboxMessages DateTime is not UTC ISO-8601 format

Calling:

await Airship.inboxMessages;

gives you a list of message center messages. The InboxMessage sentDate parameter does not come in UTC ISO-8601 format.

Example InboxMessage:

InboxMessage(
  title = "Test message"
  messageId = "9e-9gEn4Ee2BeQJC4LzypA"
  sentDate = "2022-10-12T06:42:38"
  expirationDate = null
  listIcon = null
  isRead = false
  extras = {_InternalLinkedHashMap} size = 0
)

Preliminary Info

What Airship dependencies are you using?

Airship 6.1.0 https://pub.dev/packages/airship_flutter (latest current version)

Report

What unexpected behavior are you seeing?

I expect the dates to come as UTC ISO-8601 so operations like timezone conversion and dateTime comparison could be done

What is the expected behavior?

I expect the date to come as "2022-10-12T06:42:38Z" so when DateTime parse methods are used, dateTime is set correctly.

What are the steps to reproduce the unexpected behavior?

Send a message center message, then get that InboxMessage through await Airship.inboxMessages.

java.lang.IllegalStateException

Preliminary Info

Crashing in production due to java.lang.IllegalStateException

What Airship dependencies are you using?

airship_flutter: ^6.0.1
flutter-version: 3.0.4

Report

Do you have logging for the issue?

java.lang.IllegalStateException:
at androidx.room.RoomOpenHelper.checkIdentity (RoomOpenHelper.java:163)
at androidx.room.RoomOpenHelper.onOpen (RoomOpenHelper.java:135)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onOpen (FrameworkSQLiteOpenHelper.java:201)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked (SQLiteOpenHelper.java:504)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:391)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase (FrameworkSQLiteOpenHelper.java:151)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase (FrameworkSQLiteOpenHelper.java:112)
at androidx.room.RoomDatabase.inTransaction (RoomDatabase.java:706)
at androidx.room.RoomDatabase.assertNotSuspendingTransaction (RoomDatabase.java:483)
at com.urbanairship.messagecenter.MessageDao_Impl.getMessages (MessageDao_Impl.java:155)
at com.urbanairship.messagecenter.Inbox.refresh (Inbox.java:686)
at com.urbanairship.messagecenter.Inbox.updateEnabledState (Inbox.java:222)
at com.urbanairship.messagecenter.MessageCenter.updateInboxEnabledState (MessageCenter.java:186)
at com.urbanairship.messagecenter.MessageCenter.init (MessageCenter.java:173)
at com.urbanairship.UAirship.init (UAirship.java:795)
at com.urbanairship.UAirship.executeTakeOff (UAirship.java:420)
at com.urbanairship.UAirship.access$000 (UAirship.java:66)
at com.urbanairship.UAirship$2.run (UAirship.java:379)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
at com.urbanairship.util.AirshipThreadFactory$1.run (AirshipThreadFactory.java:50)
at java.lang.Thread.run (Thread.java:919)

onPushReceived not called on iOS when App is in Background

❗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: ^6.1.0

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

Flutter 3.3.6, I am using the development airship keys and running the app on a usb-connected iphone which is running ios 15.6

Report

What unexpected behavior are you seeing?

On iOS, neither listeners registered using Airship.onPushReceived, nor listeners registered using Airship.setBackgroundMessageHandler are called when the App is in the background. On Android however, my onPushReceived listener will be executed when a Push Notification is received while the App is in the background.

When the App is in the foreground, my listeners are called and execute in the way i expect them to. Also, interestingly, when i open the app by tapping the notification inside the ios pull-down notification centre instead of tapping on the app icon on the homescreen, my listener is also executed (But only in the moment i tap the notification).

What is the expected behavior?

iOS and Android should behave in the same way, since there does not seem to be platform specific ways to register these listeners

What are the steps to reproduce the unexpected behavior?

This is the code i use to initialize Airship in my flutter App:
`Airship.takeOff(<-- airshipAppKeyDev -->, <-- airshipAppSecretDev -->);
Airship.setUserNotificationsEnabled(true);
Airship.addTags(<-- tag -->);
Airship.setAutoBadgeEnabled(false);

Airship.onPushReceived.listen((event) async {
debugPrint('Push Received $event');

Map data = json.decode(event.payload!["type"]);

debugPrint(data.toString());

data.forEach((key, value) {
  if (value) {
    store.dispatch(ToggleNavigationBadgeAction(navigationEntryID: key, value: true));
    store.dispatch(TriggerReduxPersistAction());
  }
});

Airship.setBadge(1);

});
`

Do you have logging for the issue?

These are the logs from the moment i put the App into the background:

[Airship] [D] AirshipKit/Analytics.swift applicationDidEnterBackground() [Line 278] Application did enter background.
[Airship] [D] -[UAAutomationEngine updateTriggersWithScheduleID:type:argument:incrementAmount:] [Line 662] Updating triggers with type: 1
[Airship] [D] AirshipKit/Analytics.swift addEvent(_:) [Line 404] Adding app_background event 3BD09434-4BA2-4A02-AD7B-3085B6E6B444
[Airship] [D] AirshipKit/EventStore.swift storeEvent(withID:eventType:eventTime:eventBody:sessionID:context:) [Line 207] Event saved: 3BD09434-4BA2-4A02-AD7B-3085B6E6B444
[Airship] [D] AirshipKit/ExpirableTask.swift expire() [Line 92] Expiration handler not set, marking task as failed.
[Airship] [D] AirshipKit/ExpirableTask.swift expire() [Line 92] Expiration handler not set, marking task as failed.

This is what is logged afterwards, when i open the app by clicking on the app icon:

[Airship] [D] AirshipKit/Analytics.swift applicationWillEnterForeground() [Line 270] Application will enter foreground.
[connection] nw_read_request_report [C3] Receive failed with error "Software caused connection abort"
[connection] nw_read_request_report [C2] Receive failed with error "Software caused connection abort"
[connection] nw_read_request_report [C1] Receive failed with error "Software caused connection abort"
[Airship] [D] AirshipKit/Analytics.swift applicationDidTransitionToForeground() [Line 252] Application transitioned to foreground.
[Airship] [D] -[UAAutomationEngine updateTriggersWithScheduleID:type:argument:incrementAmount:] [Line 662] Updating triggers with type: 0
[Airship] [D] -[UAAutomationEngine updateTriggersWithScheduleID:type:argument:incrementAmount:] [Line 662] Updating triggers with type: 8
[Airship] [D] AirshipKit/Analytics.swift addEvent(:) [Line 404] Adding app_foreground event 33F348C5-E3C0-4045-917C-9BF0503E0C50
flutter: Notifications in storage: [Notification(notificationId=null, alert=null, title=null, subtitle=null, extras=null)]
[Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 90 named com.apple.commcenter.coretelephony.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 90 named com.apple.commcenter.coretelephony.xpc was invalidated from this process.}
[Airship] [D] AirshipKit/ContactAPIClient.swift resolve(channelID:completionHandler:) [Line 97] Resolving contact with channel ID 96dcd93e-2dba-4e55-b4e7-0fe94116aba0
[Airship] [D] AirshipKit/Push.swift badgeNumber [Line 653] Change Badge from 4, to 0
[Airship] [D] AirshipKit/EventStore.swift storeEvent(withID:eventType:eventTime:eventBody:sessionID:context:) [Line 207] Event saved: 33F348C5-E3C0-4045-917C-9BF0503E0C50
[Airship] [D] AirshipKit/RemoteDataAPIClient.swift fetchRemoteData(locale:randomValue:lastModified:completionHandler:) [Line 53] Request to update remote data: <UARequest: 0x28398ac80>
[Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 90 named com.apple.commcenter.coretelephony.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 90 named com.apple.commcenter.coretelephony.xpc was invalidated from this process.}
[Airship] [D] AirshipKit/ChannelRegistrar.swift handleRegistrationTask(
:) [Line 218] Ignoring registration request, registration is up to date.
[Airship] [D] AirshipKit/Contact.swift logOperationResult(operation:response:error:) [Line 1063] Contact update for operation: ContactOperation(type: AirshipKit.OperationType.resolve, payload: nil) failed with response: HTTPResponse(status=403)
[Airship] [D] AirshipKit/RemoteDataManager.swift handleRefreshTask(_:) [Line 232] Remote data refresh finished with response: HTTPResponse(status=304)
[Airship] [D] -[UAInboxMessageList updateMessages:]_block_invoke [Line 496] Inbox messages updated.

[Android SDK 31] Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.

Preliminary Info

What Airship dependencies are you using?

airship_flutter: ^4.4.0

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

Android Studio Arctic Fox

Report

What unexpected behavior are you seeing?

When migrating the app to Android target SDK 31, the following error generate a runtime Crash when starting the application.

java.lang.IllegalArgumentException: package-name-here: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/AndroidRuntime(25087): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
E/AndroidRuntime(25087): at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
E/AndroidRuntime(25087): at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
E/AndroidRuntime(25087): at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
E/AndroidRuntime(25087): at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:273)
E/AndroidRuntime(25087): at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:151)
E/AndroidRuntime(25087): at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:171)
E/AndroidRuntime(25087): at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:102)
E/AndroidRuntime(25087): at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
E/AndroidRuntime(25087): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(25087): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(25087): at java.lang.Thread.run(Thread.java:920)

What is the expected behavior?

Not experiencing the crash and be able to safely publish it with SDK 31.

What are the steps to reproduce the unexpected behavior?

-> use SDK 31 as target SDK
-> run application on an Android device

Do you have logging for the issue?

onShowInboxMessage() and onShowInbox() never called for iOS

Preliminary Info

What Airship dependencies are you using?

airship_flutter: 5.1.0

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

Xcode 13.2
Flutter 2.8.0

Report

What unexpected behavior are you seeing?

The onShowInbox() and onShowInboxMessage() callbacks are not being called for iOS. They do work as expected for Android.

Airship.onShowInbox
    .listen((event) => debugPrint('Navigate to app's inbox'));

Airship.onShowInboxMessage
    .listen((messageId) => debugPrint('Navigate to message $messageId'));

What is the expected behavior?

When when the user taps on a push notification that is linked to a message center message the
onShowInboxMessage should get called.

What are the steps to reproduce the unexpected behavior?

  • run the app on iOS
  • the app registers a Airship.onShowInboxMessage listener
  • send a push notification combined with a message center message
  • the iOS app gets the push
  • tap on the push notification

Excepted: the onShowInboxMessage stream emits an event

Actual: The native message center and message view UI is displayed. The call is not called.

Additional info

I noticed that in SwiftAirshipPlugin

    public func showMessage(forID messageID: String) {
        let event = AirshipShowInboxMessageEvent(messageID)
        AirshipEventManager.shared.notify(event)
    }

Is never called.

Workaround

As a workaround, I am currently setting the MessageCenter displayDelegate manually on app startup and firing the events as follows:

import UIKit
import Flutter
import GoogleMaps
import airship_flutter
import AirshipKit

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
    private let inboxCoordinator = InboxDelegate()
    
    override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        GeneratedPluginRegistrant.register(with: self)
        
        // This is a workaround to fix the fact that Airship Flutter is never calling the showMessage() and showInbox() callbacks
        DispatchQueue.main.async {
            MessageCenter.shared.displayDelegate = self.inboxCoordinator
        }
        
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
}

class InboxDelegate:NSObject, MessageCenterDisplayDelegate {
    func displayMessageCenter(forMessageID messageID: String, animated: Bool) {
        print("displayMessageCenter \(messageID)")
        SwiftAirshipPlugin().showMessage(forID: messageID)
    }
    
    func displayMessageCenter(animated: Bool) {
        print("displayMessageCenter")
        SwiftAirshipPlugin().showInbox()
    }
    
    func dismissMessageCenter(animated: Bool) {
        print("displayMessageCenter")
    }
}

app crashed in ios when push received

❗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 5.0.1

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

[✓] Flutter (Channel stable, 2.2.0, on macOS 11.4 20F71 darwin-x64, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] IntelliJ IDEA Community Edition (version 2018.1.5)
[✓] VS Code (version 1.57.0)
[✓] Connected device (3 available)

Report

What unexpected behavior are you seeing?

click the notification and open app ,then crashed, it only happened on iphone

What is the expected behavior?

click the notification and open app, app can open successful

What are the steps to reproduce the unexpected behavior?

just send a push message with deeplink, and click the message when push received

Do you have logging for the issue?

I see the log, and found that "type 'Null' is not a subtype of type 'String'" error in class airship_flutter.dart line 60. It reference the notificationId cannot be null. Then I went to the airship docs,found notificationId only used in Android. But I don't known if it was the real cause.
image
image

iOS production key

Hi,
In the documentation it is stated that for Android airshipconfig.properties file I can set the isProduction flag and this is how production key and secret will be used. What is the rule for iOS AirshipConfig.plist file. How is it determined which key and secret is used?

The size of the iOS installation package is abnormal

❗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: 6.1.0

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

Flutter 3.3.4
Xcode 13.4.1

Report

What unexpected behavior are you seeing?

The installation size of iOS has increased by about 40m

airship_flutter: 5.4.0 ios-library: 16.7.0 ios framework size:19.3m
airship_flutter: 6.1.0 ios-library: 16.9.3 ios framework size:61.9m
airship_flutter: ----- ios-library: 16.10.2 ios framework size:20.4m

What is the expected behavior?

ios-library is greater than or equal to 16.10.0

Airship.addEvent doesn't work if CustomEvent's value is null

Preliminary Info

What Airship dependencies are you using?

airship_flutter: ^6.2.2

Report

What unexpected behavior are you seeing?

When using Airship.addEvent(event) iOS doesn't add the event if the CustomEvent value is null because of this line in SwiftAirshipPlugin.swift:

        guard let value = event[eventValueKey] as? Int else {
            result(nil)
            return
        }

What is the expected behavior?

On Android the event is still recorded. I would expect the same for iOS or for the value to not be optional or at least a warning in the code saying a non-null value needs to be passed in.

What are the steps to reproduce the unexpected behavior?

Set up a custom event like this:
final event = CustomEvent('event name here', null);
Airship.addEvent(event);
The event will not be added or show up in the Airship console.

Update to Airship iOS 16.10?

Preliminary Info

Can a new version of airship_flutter that depends on Airship iOS @16.10 be released?

What Airship dependencies are you using?

airship_flutter 6.1.0

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

Xcode 14.0.1

Report

What unexpected behavior are you seeing?

I can't use the Live Activities features in an app that has a Flutter component.

What is the expected behavior?

Either of these two behaviors:

  • Opportunity to upgrade to a version of airship_flutter that automatically installs Airship/Core at 16.10 or higher, or
  • Successful pod install with 'Airship/Core', '16.10.3' in Podfile and airship_flutter: ^6.1.0 in pubspec.yaml

What are the steps to reproduce the unexpected behavior?

  1. In the sample project, specify `pod 'Airship/Core', '16.10.3'

Thanks!

Airship 5.1.1 causing crash on android 6

Hi, after updating the airship version, it is causing a crash on android 6.0 users(API level 23)
Can you guys suggest a fix for that?

Edit note: I have no problem with airship_flutter: 5.1.0& android airship SDK 16.1.0. What is the difference between these two versions?

Preliminary Info

flutter: 2.10.0
dart: 2.16.0
airship_flutter: ^5.1.1
android airship SDK: 16.1.1

Report

flutter doctor:

[✓] Flutter (Channel stable, 2.10.0, on macOS 12.2 21D49 darwin-x64, locale en-TR)
    • Flutter version 2.10.0 at /Users/kaantahakoken/fvm/versions/2.10.0
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5f105a6ca7 (7 days ago), 2022-02-01 14:15:42 -0800
    • Engine revision 776efd2034
    • Dart version 2.16.0
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/kaantahakoken/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/kaantahakoken/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/kaantahakoken/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.64.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (2 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 6.0 (API 23) (emulator)
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 98.0.4758.80
    ! Error: iPhone is not connected. Xcode will continue when iPhone is connected. (code -13)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Crashlog:

I[/FlutterAutopilot]()( 4486): onAirshipReady
D[/TransportRuntime.SQLiteEventStore]()( 4486): Storing event with priority=HIGHEST, name=FIREBASE_CRASHLYTICS_REPORT for destination cct
D[/TransportRuntime.JobInfoScheduler]()( 4486): Scheduling upload for context TransportContext(cct, HIGHEST, MSRodHRwczovL2NyYXNobHl0aWNzcmVwb3J0cy1wYS5nb29nbGVhcGlzLmNvbS92MS9maXJlbG9nL2xlZ2FjeS9iYXRjaGxvZ1xBSXphU3lCcnBTWVQ0RkZMMDlyZUhKaTZIOUZZZGVpU25VVE92Mk0=) with jobId=-1157680296 in 1000ms(Backend next call timestamp 1644393045602). Attempt 1
E[/AndroidRuntime]()( 4486): FATAL EXCEPTION: UrbanAirship#1
E[/AndroidRuntime]()( 4486): Process: com.trgain.mikrogain.dev, PID: 4486
E[/AndroidRuntime]()( 4486): java.lang.NoClassDefFoundError: com.urbanairship.messagecenter.MessageDao$$ExternalSyntheticLambda0
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.messagecenter.MessageDao.deleteMessages(MessageDao.java:68)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.messagecenter.MessageDao_Impl.access$001(MessageDao_Impl.java:23)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.messagecenter.MessageDao_Impl.deleteMessages(MessageDao_Impl.java:225)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.messagecenter.InboxJobHandler.updateInbox(InboxJobHandler.java:264)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.messagecenter.InboxJobHandler.updateMessages(InboxJobHandler.java:202)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.messagecenter.InboxJobHandler.onUpdateMessages(InboxJobHandler.java:136)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.messagecenter.InboxJobHandler.performJob(InboxJobHandler.java:117)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.messagecenter.Inbox.onPerformJob(Inbox.java:204)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.messagecenter.MessageCenter.onPerformJob(MessageCenter.java:228)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.job.JobRunnable$1.run(JobRunnable.java:90)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.util.SerialExecutor$1.run(SerialExecutor.java:41)
E[/AndroidRuntime]()( 4486): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
E[/AndroidRuntime]()( 4486): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
E[/AndroidRuntime]()( 4486): 	at com.urbanairship.util.AirshipThreadFactory$1.run(AirshipThreadFactory.java:50)
E[/AndroidRuntime]()( 4486): 	at java.lang.Thread.run(Thread.java:818)
E[/Surface]() ( 4486): getSlotFromBufferLocked: unknown buffer: 0xb40fe6a0
D[/TransportRuntime.SQLiteEventStore]()( 4486): Storing event with priority=DEFAULT, name=FIREPERF for destination cct
D[/TransportRuntime.JobInfoScheduler]()( 4486): Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy1wYS5nb29nbGVhcGlzLmNvbS92MS9maXJlbG9nL2xlZ2FjeS9iYXRjaGxvZ1xBSXphU3lDY2traUg4aTJaQVJ3T3MxTEV6RktsZDE1YU9HOG96S28=) is already scheduled. Returning...

Method setNamedUser has no effect in AirshipConsole

Preliminary Info

What Airship dependencies are you using?

Screenshot 2022-01-24 at 16 09 27

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

Flutter 2.8.0 • channel stable

Report

What unexpected behavior are you seeing?

When calling setNamedUser I want to find the user id in the airship console

await Airship.setNamedUser('user-id-test');
Screenshot 2022-01-24 at 15 58 03

What is the expected behavior?

Screenshot 2022-01-24 at 15 58 33

What are the steps to reproduce the unexpected behavior?

Install app -> call set name-> try send named notification

Do you have logging for the issue?

No

Airship.onChannelRegistration is never called on iOS

What Airship dependencies are you using?

airship_flutter: ^6.2.1

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

[✓] Flutter (Channel stable, 3.3.10, on macOS 12.6 21G115 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.74.2)
[✓] Connected device (3 availabl

Report

What unexpected behavior are you seeing?

Airship.onChannelRegistration is never called on iOS. I believe the discrepancy is within AirshipEventHandler.swift. It appears that file no longer abides by the RegistrationDelegate therefore the function is never executed. I believe the current signature for the RegistrationDelegate within the iOS library looks like this.
@objc optional func apnsRegistrationSucceeded(withDeviceToken deviceToken: Data).

I think this may have been an issue since version 5.0 of the library when the reference to the RegistrationDelegate was updated.

The file in question: https://github.com/urbanairship/airship-flutter/blob/main/ios/Classes/AirshipEventHandler.swift

Badges not showing on iOS devices

❗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: ^4.3.0

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

Flutter (Channel stable, 2.2.3), Android Studio (version 4.2)

Report

What unexpected behavior are you seeing?

While push notifications do work, on iOS devices badge won't appear on the app icon when receiving notifications.
Sadly the documentation provide only native methods to enable badging/auto-badging and it seems like there are no flutter methods to do so.

What is the expected behavior?

Implementing badging/auto-badging in Flutter code

What are the steps to reproduce the unexpected behavior?

Setup a push receiving app on iOS and send push notifications via a PHP Api

Do you have logging for the issue?

Package changes Android build directory

Preliminary Info

What Airship dependencies are you using?

4.4.0

Report

What unexpected behavior are you seeing?

Builded APKs appears in ./android/app/build/outputs/apk/$flavor/release/

What is the expected behavior?

Builded APKs are located in ./build/app/outputs/apk/$flavor/release/

What are the steps to reproduce the unexpected behavior?

Add airship_flutter dependency to flavored Flutter project.

Ideas

I think, it can be related with wrong gradle/wrapper location of this repo.
I suppose, gradle/wrapper should be located in android/ dir.

Can't migrate 4.3.0 to 5.0.1

Can't build the app when I try update the version to latest.

What Airship dependencies are you using?

airship_flutter 4.3.0 to 5.0.1 migration

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

Android Compile SDK 31
Kotlin version 1.4.32
Gradle 7.0.0

[✓] Flutter (Channel stable, 2.5.3, on macOS 12.0.1 21A559 darwin-x64, locale en-TR)
    • Flutter version 2.5.3 at /Users/kaantahakoken/fvm/versions/2.5.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (7 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/kaantahakoken/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/kaantahakoken/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/kaantahakoken/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.1, Build version 13A1030d
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.62.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • Mi 9T (mobile) • c22e6ace • android-arm64  • Android 11 (API 30)
    • Chrome (web)   • chrome   • web-javascript • Google Chrome 96.0.4664.55
    ! Error: iPhone’u is not connected. Xcode will continue when iPhone is connected. (code -13)

• No issues found!

Report

What unexpected behavior are you seeing?

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDevDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.4.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.4.0)
     Duplicate class androidx.lifecycle.ViewModelProviderKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.4.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.4.0)
     Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.4.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.4.0)

     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

Flutter 3.10.0 support

Preliminary Info

What Airship dependencies are you using?

airship_flutter: ^6.3.1

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

Flutter 3.10.0
Dart 3.0.0
DevTools 2.23.1

Report

What unexpected behavior are you seeing?

I see the following error during flutter pub get:

Because airship_flutter >=4.3.0 depends on intl >=0.15.7 <0.18.0 and every version of flutter_localizations from sdk depends on intl 0.18.0, airship_flutter >=4.3.0 is incompatible with
  flutter_localizations from sdk.

pubspec.yaml snippet:

  airship_flutter: ^6.3.1
  flutter_localizations: # gives us support for plurals
    sdk: flutter

What is the expected behavior?

flutter pub get succeeds, as it does with this change: main...mnespor:airship-flutter:main
pubspec.yaml:

  airship_flutter:
    git:
      url: https://github.com/mnespor/airship-flutter.git
      ref: main
  flutter_localizations: # gives us support for plurals
    sdk: flutter

What are the steps to reproduce the unexpected behavior?

  1. Use the latest version of airship_flutter alongside the latest version of flutter_localizations.
  2. Execute flutter pub get

Do you have logging for the issue?

No logs available

Push Notification don't open activity after click

Hi,

I'm sending push notification through the console and the message arrives successfully on Android (i'm testing just android now).

To test it, I touch the Android Home button, to let the app go to the background.

But when I click in the notification, it don't open my app, it just close the notification.

I can see in the console that the message arrives in the Airship.onPushReceived event and when I click in the notification it arrives in the Airship.onNotificationResponse event.

This is the logs when my app receives the push.
logs1.txt

This is the logs after click in the notication:
logs2.txt

Can you help? Thank you.

iOS app crash on start. "unrecognized selector sent to instance"

Preliminary Info

What Airship dependencies are you using?

pubspec.yaml:
airship_flutter: ^5.1.0

Podfile.lock:
PODS:

  • Airship/Automation (16.1.2):
    • Airship/Core
  • Airship/Basement (16.1.2)
  • Airship/Core (16.1.2):
    • Airship/Basement
  • Airship/MessageCenter (16.1.2):
    • Airship/Core
  • Airship/PreferenceCenter (16.1.2):
    • Airship/Core
  • airship_flutter (5.1.0):
    • Airship/Automation (~> 16.1.1)
    • Airship/Core (~> 16.1.1)
    • Airship/MessageCenter (~> 16.1.1)
    • Airship/PreferenceCenter (~> 16.1.1)
    • Flutter

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

[✓] Flutter (Channel stable, 2.8.0, on macOS 11.6 20G165 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.63.2)

Report

What unexpected behavior are you seeing?

ios app crash on startup

What are the steps to reproduce the unexpected behavior?

This doesnt appear to occur on airship_flutter: ^4.4.0

Create a new flutter app.
add dependency for airship_flutter.
adjust the ios platform to 12.0 in both locations per airship docs.
add an appropriate airshipconfig.plist file
run to see the crash.

I also attempted to add the ObjC linker flag per this post:
https://stackoverflow.com/questions/18897103/urban-airship-crashes-when-calling-takeoff

Do you have logging for the issue?

iOS console output log:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString count]: unrecognized selector sent to instance 0xe629e2c297789435'
*** First throw call stack:
(
0 CoreFoundation 0x0000000102c99ba4 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x000000010231bbe7 objc_exception_throw + 48
2 CoreFoundation 0x0000000102ca8811 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 CoreFoundation 0x0000000102c9e0ac forwarding + 1433
4 CoreFoundation 0x0000000102ca01d8 _CF_forwarding_prep_0 + 120
5 libswiftFoundation.dylib 0x0000000103da20c1 $ss15_arrayForceCastySayq_GSayxGr0_lFSayyXlGAByXlRszr0_lIetgo_Tp5 + 673
6 libswiftFoundation.dylib 0x0000000103dcf68f $sSa10FoundationE36_unconditionallyBridgeFromObjectiveCySayxGSo7NSArrayCSgFZ + 239
7 AirshipKit 0x000000010121b3bc $s10Ai<…>

Airship.activeNotifications not parsing on iOS

Preliminary Info

What Airship dependencies are you using?

airship_flutter: 6.2.1

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

N/A

Report

What unexpected behavior are you seeing?

On iOS, when making a call to Airship.activeNotifications, the Future completes with the correct number of items however all properties on each Notification object in the list are null.

In Notification._internal (lib/src/airship_flutter.dart line 79), the properties in the json parameter for one of our given notifications when received on iOS are:

"aps" -> Map (2 items)
"^d" -> "our deep link URL"
"_" -> "e9cbf939-..."
"com.urbanairship.interactive_actions" -> Map (2 items)
"com.urbanairship.metadata" -> "..."

On Android, they are:

"alert" -> "our alert"
"title" -> "our title"
"subtitle" -> "our summary"
"extras" -> Map (9 items)
"notification_id" -> "our id"
"notificationId" -> "our id"

What is the expected behavior?

Android and iOS decode the notifications in the same way.

What are the steps to reproduce the unexpected behavior?

  1. Send a notification from the Airship dashboard to both platforms
  2. Launch the app without tapping on the notification
  3. When making a call to Airship.activeNotifications, note using an appropriate method the contents of the list of notifications returned

Do you have logging for the issue?

N/A

Unresolved reference: AirshipReceiver

Preliminary Info

What Airship dependencies are you using?

com.urbanairship.android:urbanairship-fcm:11.0.1
[and the firebase dep.]

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

Latest version of Android Studio

Report

What unexpected behavior are you seeing?

When building the application (running gradle clean build also) it throws the following error (also compatible with AndroidX already):

e: /Users/leviroelofsma/flutter/.pub-cache/git/airship-flutter-8fdc4a3a61dca99fb59ac02b68916af6255634b5/android/src/main/kotlin/com/airship/flutter/Extensions.kt: (3, 25): Unresolved reference: AirshipReceiver

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':airship:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Finished with error: Gradle task assembleDebug failed with exit code 1

What is the expected behavior?

It needs to automatically resolves the com.airship.airshipreceiver

What are the steps to reproduce the unexpected behavior?

Follow the insturctions or this plugin to install and add the dependencies.

Do you have logging for the issue?

Launching lib/main.dart on SM G950F in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
e: /Users/leviroelofsma/flutter/.pub-cache/git/airship-flutter-8fdc4a3a61dca99fb59ac02b68916af6255634b5/android/src/main/kotlin/com/airship/flutter/Extensions.kt: (3, 25): Unresolved reference: AirshipReceiver

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':airship:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Finished with error: Gradle task assembleDebug failed with exit code 1

InboxMessageView is blank after opening it on iOS when app is not in background

Preliminary Info

Opening an iOS message after getting a onShowInboxMessage (when opening a push notification) event from Airship.onShowInboxMessage and navigating to the message (using a MaterialPage to open a component that has InboxMessageView) does not load the message view.

What Airship dependencies are you using?

Airship 6.1.0 https://pub.dev/packages/airship_flutter (latest current version)

Report

What unexpected behavior are you seeing?

IMPORTANT: this only happens on iOS AND when the application is NOT running in the background.
P.S. if the app is already opened or in the background, the InboxMessageView works fine.

This issue happens when the user opens the app from a push notification and Airship.onShowInboxMessage is triggered.

The example shows a blank page after navigation:
image

After the initial opening, If I open the message again it works.

For now, I've solved the issue by using a FutureBuilder:

             FutureBuilder<String>(
                future: Future.delayed(1.seconds, () => ''),
                builder: (context, snapshot) => snapshot.hasData //
                    ? Expanded(child: InboxMessageView(messageId: _messageId))
                    : const HavenProgressIndicator(),
              )

This solves the issue since I think it might be a race condition of Flutter trying to show the message via InboxMessageView and Airship initializing on iOS.

What is the expected behavior?

The InboxMessageView should show the message center message if it is opened from a push notification and navigated to a component via InboxMessageView.

This works for Android, but not for IOS.

What are the steps to reproduce the unexpected behavior?

In order to replicate this:

  1. Use an iOS device;
  2. Have an InboxMessageView set up to show a message after Airship.onShowInboxMessage stream is updated with a messageId;
  3. Do not have the application in the background (in order to test you can use a --release mode)
  4. Send a push notification + message center message to the app;
  5. Open the push notification (it should open an InboxMessageView with a messageId)

Add the ability to send a RegionEvent

The current Flutter SDK allows for the ability to add a CustomEvent but I need the ability to add a RegionEvent (exists in android and ios SDKs) in order to complete a Gimbal Integration. In looking through the implementation it doesnt appear that this can be achieved through the CustomEvent implementation and would require the additional type.

Android InboxMessageView CTA link is not opening

Preliminary Info

What Airship dependencies are you using?

airship_flutter - 5.1.0

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

Visual Studio Code, running with Debugger using official Dart and Flutter extensions

Flutter Doctor:

    [✓] Flutter (Channel stable, 2.10.1, on macOS 11.6.4 20G417 darwin-x64, locale en-US)
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2020.3)
    [✓] VS Code (version 1.64.2)
    [✓] Connected device (3 available)
    [✓] HTTP Host Availability

Report

What unexpected behavior are you seeing?

Using the InboxMessageView widget provided by airship_flutter a call to action link is not opening a browser and navigating to the URL on an Android device. The link is working on iOS.

What is the expected behavior?

When clicking the link (button) within the inbox message on Android it should open a web browser to navigate to the URL as it does on iOS.

What are the steps to reproduce the unexpected behavior?

  1. Open an inbox message that contains a CTA button link to a URL.
  2. Click the button
  3. Nothing happens on Android while on iOS a safari browser is opened and navigates to the URL

Do you have logging for the issue?

UALib(  851): Running run actions command with callback for URL: uairship://run-action-cb/^u/%22https%3A%2F%2F[URL]%2F%22/ua-cb-3
UALib(  851): Action: ^u, Args: "https://[URL]/", Callback: ua-cb-3
UALib(  851): Action com.urbanairship.actions.OpenExternalUrlAction@1b47de3 is unable to accept arguments: ActionArguments { situation: 3, value: "https:\/\/[URL]\/", metadata: Bundle[{com.urbanairship.REGISTRY_ACTION_NAME=^u, com.urbanairship.RICH_PUSH_ID_METADATA=UPxD4L9jEeyJ4QJCLOtUNA}] }
UALib(  851): Running run actions command with callback for URL: uairship://run-action-cb/custom_action_cta_click/%7B%22ctaTitle%22%3A%22Gift%20Cards%22%2C%22messageTitle%22%3A%2220220418%20Test%22%2C%22headlineText%22%3A%22Header%20content%22%7D/ua-cb-4
UALib(  851): Action: custom_action_cta_click, Args: {"ctaTitle":"Gift Cards","messageTitle":"20220418 Test","headlineText":"Header content"}, Callback: ua-cb-4
V/InputMethodManager(  851): b/117267690: Failed to get fallback IMM with expected displayId=6 actual IMM#displayId=0 view=com.urbanairship.messagecenter.webkit.MessageWebView{b8298d6 VFEDHVC.. .F...... 0,0-1080,1823}

a

❗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: ^4.1.1

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

Flutter 1.26.0-17.6.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision a29104a69b (11 days ago) • 2021-02-16 09:26:56 -0800
Engine • revision 21fa8bb99e
Tools • Dart 2.12.0 (build 2.12.0-259.12.beta)

Report

What unexpected behavior are you seeing?

notificationChannel in airshipconfig.properties as documented in README.md is wrong (or the properties parser implementation is wrong). The example is using quotes but if quotes are used the following error would be displayed when no notification_channel is indicated in the Send a Push API request.

This is because in properties files quotes or double quotes are considered part of the string.

What is the expected behavior?

That the sample configuration provided works when a customChannel notification channel is created and no notification_channel used in the request.
I believe this is just a documentation issue (do not think it was intended to divert from the .properties format... although it is not really a standard).
Expected behaviour is to either align the documentation, which should propagate to pub.dev et al. Otherwise, modify the implementation so that double quotes are not considered part of the strings when reading airshipconfig.properties.

What are the steps to reproduce the unexpected behavior?

  1. Start simple flutter project.
  2. Add airship_flutter, an airshipconfig.properties configuration as per the README.md (including a valid key and secret).
  3. Create a custom notification channel named customChannel (for example via flutter_local_notifications):
import 'package:flutter_local_notifications/flutter_local_notifications.dart';

 // Create notification channels (via Flutter)
  const AndroidNotificationChannel androidNotificationChannel = AndroidNotificationChannel(
    'customChannel',
    'Important notifications',
    'The Notification Channel for urgent/pop up stuff',
    importance: Importance.max,
  );

  final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
  await flutterLocalNotificationsPlugin
      .resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>()
      ?.createNotificationChannel(androidNotificationChannel);
  1. Send a Push without indicating notification_channel.

Do you have logging for the issue?

E/startup_namer - UALib(12299): Notification channel "customChannel" does not exist. Falling back to com.urbanairship.default

Messages in the message center on iOS appear as read first

Preliminary Info

What Airship dependencies are you using?

1.0.1

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

not relevant

Report

What unexpected behavior are you seeing?

When using the message center (basically just copy&pasting the example code), then it all works fine in Android. I see new messages as unread, after reading them in the detail view, they get marked as read. However on iOS, the initial state is read, and after reading them, they are marked as unread. I guess there is a simple small bug in the library.

What is the expected behavior?

Messages are always unread when they are "new"

What are the steps to reproduce the unexpected behavior?

Send a message and then open the notification center.

LateInitializationError: Local 'notification' has not been initialized.

Preliminary Info

What Airship dependencies are you using?

airship_flutter: ^4.0.0
pubspec.lock: airship_flutter: 4.4.0
(Know this isn't the latest version but looking at the repo this issue is still present in latest)

Report

What unexpected behavior are you seeing?

When receiving a push notification payload on the client after triggering a push from the Apptentive Message center using their airship integration, the deserialization of that payload fails because there is no notification object in the payload.

The instance member notification is non-nullable, but the _fromJson method uses a late declaration and a null check in conjunction when they shouldn't be if notification can be null as it is in my case.

Screen Shot 2022-01-03 at 12 04 12 PM

What is the expected behavior?

Expect notification to be nullable if not present in payload

What are the steps to reproduce the unexpected behavior?

Send a notification without a notification property

Do you have logging for the issue?

Screen Shot 2022-01-03 at 11 47 35 AM

can't run successful in android platform after add airship_flutter plugin

Preliminary Info

What Airship dependencies are you using?

airship_flutter: ^4.3.0

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

[✓] Flutter (Channel stable, 2.2.0, on macOS 11.4 20F71 darwin-x64, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] IntelliJ IDEA Community Edition (version 2018.1.5)
[✓] VS Code (version 1.57.0)
[✓] Connected device (3 available)

Report

What unexpected behavior are you seeing?

We add airship plugin follow the guide doc both ios and android. But can't run successful in android device. It cause BuildConfig not found we used in other Class.When remove airship_flutter it can run successful without any other single code!

What is the expected behavior?

Run successful both on ios and android platform.

What are the steps to reproduce the unexpected behavior?

Just add airship plugin follow the guide doc flutter getting started

Do you have logging for the issue?

error message "Unresolved reference: BuildConfig" used in Logger.setLoggable(BuildConfig.DEBUG)

fatal error: module 'airship_flutter' not found

Preliminary Info

What Airship dependencies are you using?

airship_flutter: ^3.0.1

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

Flutter 1.12.13+hotfix.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f139b11009 (8 days ago) • 2020-03-30 13:57:30 -0700
Engine • revision af51afceb8
Tools • Dart 2.7.2

Report

What unexpected behavior are you seeing?

Unable to build to iOS device. receiving the following: fatal error: module 'airship_flutter' not found. I am able to build on the Beta Flutter channel but I'd rather be on Stable if possible.

What is the expected behavior?

Build to iOS device

What are the steps to reproduce the unexpected behavior?

Do you have logging for the issue?

Building App.framework for armv7... Building AOT snapshot in release mode (ios-release)... 14.3s Built to build/aot/. warning: parsing line table prologue at offset 0x6f697463 found unsupported version 0x00 warning: line table parameters mismatch. Cannot emit. note: while processing /Users/aescutia/git/test_airship/build/aot/armv7/snapshot_assembly.o Project /Users/aescutia/git/test_airship built and packaged successfully. /Users/aescutia/git/test_airship/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'airship_flutter' not found @import airship_flutter; ~~~~~~~^~~~~~~~~~~~~~~ 1 error generated. note: Using new build system note: Building targets in parallel note: Planning build note: Constructing build description

MessageCenter - InboxMessageView custom layout

Not a bug report but more question. Is there a proper way of overwriting/customising InboxMessageView? It would be very important to have such possibility since every app needs it's own design and currently MessageCenter is quite poor when it comes to layout customisation

Named User cannot be unset in IOS

Preliminary Info

What Airship dependencies are you using?

5.1.1

Report

What unexpected behavior are you seeing?

Named User cannot be unset in IOS, on Previous versions with await Airship.setNamedUser(''); on logout we could remove the namedUser. on Android the same call can clear the namedUser fine and calling await Airship.namedUser will return null but on IOS it returns the last namedUser.

What is the expected behavior?

there should be a way to unset the namedUser in IOS. based on the documentation it is possible by Airship.contact.reset() but in the plugin there is no method to do so

workaround : if you look at the SwiftAirshipPlugin.swift

private func setNamedUser(_ call: FlutterMethodCall, result: @escaping FlutterResult) {

you are checking the arguments type and if its not String the else block which will reset the namedUser will be called, so passing a null dynamic argument (cause the parameter is non nullable) solve the issue but i think it can be easily fix if you expose a method to reset the namedUsers if the user do logging out.

jsonDecode failure

I cloned your example project and threw in my Airship keys/required files/dependencies to try out push notifications on a Flutter app on a Pixel 3XL running Android 10. The notification gets delivered but doesn't seem to get parsed correctly by the Airship dart library. I put a breakpoint on the Airship.onPushReceived.map lambda and the value is always an empty string in my testing, which when passed to the jsonDecode method throws an exception. There's probably something wrong with my configuration somewhere, but I don't really know what that'd be. Any insight into why the value is always an empty string?

E/flutter ( 4702): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: FormatException: Unexpected end of input (at character 1)
E/flutter ( 4702): 
E/flutter ( 4702): ^
E/flutter ( 4702): 
E/flutter ( 4702): #0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1394:5)
E/flutter ( 4702): #1      _ChunkedJsonParser.close (dart:convert-patch/convert_patch.dart:512:7)
E/flutter ( 4702): #2      _parseJson (dart:convert-patch/convert_patch.dart:32:10)
E/flutter ( 4702): #3      JsonDecoder.convert (dart:convert/json.dart:495:36)
E/flutter ( 4702): #4      JsonCodec.decode (dart:convert/json.dart:153:41)
E/flutter ( 4702): #5      jsonDecode (dart:convert/json.dart:96:10)
E/flutter ( 4702): #6      Airship.onPushReceived.<anonymous closure> (package:airship/src/airship.dart:257:61)
E/flutter ( 4702): #7      _MapStream._handleData (dart:async/stream_pipe.dart:229:21)
E/flutter ( 4702): #8      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:166:13)
E/flutter ( 4702): #9      _rootRunUnary (dart:async/zone.dart:1134:38)
E/flutter ( 4702): #10     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter ( 4702): #11     _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
E/flutter ( 4702): #12     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:338:11)
E/flutter ( 4702): #13     _DelayedData.perform (dart:async/stream_impl.dart:593:14)
E/flutter ( 4702): #14     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:709:11)
E/flutter ( 4702): #15     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:669:7)
E/flutter ( 4702): #16     _rootRun (dart:async/zone.dart:1122:38)
E/flutter ( 4702): #17     _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter ( 4702): #18     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter ( 4702): #19     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
E/flutter ( 4702): #20     _rootRun (dart:async/zone.dart:1126:13)
E/flutter ( 4702): #21     _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter ( 4702): #22     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter ( 4702): #23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
E/flutter ( 4702): #24     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
E/flutter ( 4702): #25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
E/flutter ( 4702): 

InboxMessageView - Web Deep Links not working

Preliminary Info

What Airship dependencies are you using?

airship_flutter - 5.2.0

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

  • Visual Studio Code, running with Debugger using official Dart and Flutter extensions
  • I should note, when creating message in Airship, we are not using the "Deep Link" feature, we are simply assigning URLs to buttons. So the uairship:// scheme is not appended to these links.

Flutter Doctor:

[✓] Flutter (Channel stable, 2.10.4, on macOS 12.1 21C52 darwin-arm, locale
    en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.66.0)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

Report

What unexpected behavior are you seeing?

When using the InboxMessageView widget provided by airship_flutter, web deep links (Example deep link: https://amc.film/3C3S1d1) are not internally routing to the respective screen in-app and are opening in-browser. Though when opened outside of the application, the deep links route to the correct screen in-app.

What is the expected behavior?

When clicking on a URL/Deep Link embedded in the InboxMessageView widget provided by airship_flutter, the user should be routed to the correct screen in-app.

What are the steps to reproduce the unexpected behavior?

  1. Open the application.
  2. Navigate to an Airship message (Rendered by InboxMessageView).
  3. Click on an deep link embedded in the InboxMessageView.
  4. Notice: The user is redirected to their respective link in their browser.
    Expected: The user should be routed to the respective screen in-app. (Again, when opening the same link from outside of the app, the user is redirected to the correct screen in-app as expected.)

Do you have logging for the issue?

No pertinent logs exist as no errors were thrown from this behavior.

Other Notes

When utilizing the WebView widget in-app from the webview_flutter package, we have access to a navigationDelegate argument where we can decide how to handle a specific navigation request and determine if a URI matches our deep link scheme. Is the expectation that developers should implement Airship messages in a WebView to have deep link support? Should there be a navigationDelegate or similar argument on InboxMessageView? Or should this behavior work out of the box?

NoClassDefFoundError.

flutter version 3.3.4
airship_flutter 6.1.0

android version under 7 alawys crash

Fatal Exception: Java. lang.NoClassDefFoundError
Failed resolution of: Lcom/urbanairship/iam/InAppMessageActivity;
com.urbanairship.lam.modal. ModalAdapter.newAdapter (ModalAdapter java:37) com.urbanairship.lam.modal.ModalAdapterFactory. createAdapter (ModalAdapterFactory java:18) com.urbanairship.lam.InAppMessageManager.createAdapterWrapper(InAppMessageManager.java:540) com.urbanairship.iam.InAppMessageManager.onPrepare(InAppMessageManagerjava:264) com.urbanairship.automation.InAppMessageScheduleDelegate.onPrepareSchedule(InAppMessageScheduleDelegate.java:39) com.urbanairship. automation.InAppMessageScheduleDelegate.onPrepareSchedule (InAppMessageScheduleDelegate.java: 16) com.urbanairship.automation.InAppAutomation. prepareSchedule (InAppAutomation.java:588)
com.urbanairship.automation.InAppAutomation.lambdaSonPrepareSchedule$4$InAppAutomation(InAppAutomation.java:565)
com.urbanairship.automation.-S$LambdaSinAppAutomation$ZaYl-wy944HuRn6g3czKz0KnJ-Q.run(lambda)
com.urbanairship.util. RetryingExecutor$[email protected] (RetryingExecutor.java:205)
com.urbanairship.util.RetryingExecutor$1.run (RetryingExecutor. java:126)
com.urbanairship.til.SerialExecutor$1.run (SerialExecutor.java:41)
java.util concurrent. ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133)
java. util concurrent. ThreadPoo/ExecutorSWorker.run (ThreadPoolExecutor java:607) com.urbanairship.util. AirshipThreadFactory$1.run (Airship ThreadFactory java:50) lava.lang. Thread.run (Thread java.762)

Caused by java.lang.ClassNotFoundException
Didn't find class *com.urbanairship.lam.InAppMessageActivity" on path: DexPathList[[zip file /data/app/com.app.androld.qw.readink-1/base.apk", zip file /data/app/com.app.android.qw.readink-1/split_config.arm64_v8a.apk', zip file/data/app/com.app.android.qw.re adink-1/split_config.en.apk', zip file /data/app/com.app.android.qw.readink-1/split_config.xxxhdpi.apk', zip file /data/user/0/com.ap p.android.qw.readink/.sagittarius/1/1.jar',zipfile/data/user/0/com.app.android.qw.readink/.sagittarlus/1/2-jar",zipfile/data/user/ 0/com.app.android. qw.readink/.sagittarius/1/3.jar, zip file /data/user/0/com.app.androld.qw.readink/.sagittarius/1/4,jarl.nativel.ibr aryDirectories=//data/app/com.app.android.qw.readink-1/lib/arm64,/data/app/com.app.androld.qw.readink-1/base.apk!/lib/arm64-v 8a, /data/app/com.app.android.qw.readink-1/split_config.arm64_v8a.apk/lib/arm64-v8a,/data/app/com.app.android.qw.readink-1/s plit_config.en.apk!/lib/arm64-v8a,/data/app/com.app.android.qw.readink-1/split_config.xxxhdpi.apkl/lib/arm64-v8a,/system/lib64,/V endor/lib64]

iOS not work

Hi,

I'm having difficulty to make the Push Notifications to work on iOS, did all the configurations on Apple Developer and also on Firebase, add the Push Certificate (.p12) in the Channels in your platform, try to send the push and nothing happens.
If i try to use the Firebase, the app receives with success, but on your platform, no.
Already tried to use the Project Live and Project Test, with both developer and production certificates, and nothing happens.
I found awkward that your platform sees the app was open with success, but won't deliver the Push Notification.

Here's the git of my project:
https://github.com/viniciusfragelli/FlutterUrbanTest

Best Regards,
Vinicius

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.