Troubleshooting for the Flutter Plugin
Common issues and solutions for Airship Flutter plugin setup, initialization, and integration.
This troubleshooting guide will help you resolve common issues with the Airship Flutter plugin.
Common Issues
Below are solutions to common issues you may encounter when integrating the Airship Flutter plugin.
Installation Errors
If you encounter errors during installation:
- Verify that you’re using a compatible version of Flutter (3.0.2+)
- Ensure all native dependencies are properly linked
- Run
flutter cleanandflutter pub getto refresh dependencies - For iOS, run
pod installin theiosdirectory - Check that your iOS and Android projects are correctly configured
Initialization Errors
If you encounter errors during SDK initialization:
- Verify your credentials in the Airship dashboard under Settings → APIs & Integrations → App Keys
- Check that
takeOffis called correctly in your app (beforerunApp) - Verify the
siteconfiguration matches your Airship project (US vs EU)
Push Notifications Not Working
If push notifications are not being received:
- Verify that push notifications are enabled for both iOS and Android
- Check that APNs (iOS) and FCM (Android) are properly configured
- Ensure the app has notification permissions
- For iOS, verify capabilities are enabled in Xcode (Push Notifications and Background Modes)
- For Android, ensure
google-services.jsonis inandroid/app/
Checking Push Notification Status
If push notifications aren’t working as expected, you can check the notification status to diagnose the issue:
PushNotificationStatus? status = await Airship.push.notificationStatus;
print('User notifications enabled: ${status?.isUserNotificationsEnabled}');
print('System notifications allowed: ${status?.areNotificationsAllowed}');
print('Push privacy feature enabled: ${status?.isPushPrivacyFeatureEnabled}');
print('Push token registered: ${status?.isPushTokenRegistered}');
print('User opted in: ${status?.isUserOptedIn}');
print('Fully opted in: ${status?.isOptedIn}');You can also listen for status changes:
Airship.push.onNotificationStatusChanged.listen((event) {
print('Notification status changed: ${event.status}');
print('Is opted in: ${event.status.isOptedIn}');
});Common Status Scenarios:
isUserOptedIn = false: Check ifuserNotificationsEnabledis set totrueand if the user granted permissionisPushPrivacyFeatureEnabled = false: Push privacy feature is disabled in Privacy ManagerisPushTokenRegistered = false: Device hasn’t received a push token yet—check network connectivity and platform configurationisUserOptedIn = truebutisOptedIn = false: Push token registration is pending or failed—check console logs for errors
Feedback
Was this page helpful?
Thank you
Thanks for your feedback!
Tell Us MoreThank you
We will try harder!
Tell Us MoreCategories