Push Notifications FAQs
Quick answers to common Push Notifications questions.
Getting Started
Q: What is the Push Notifications SDK?
A: The Push Notifications SDK lets you send targeted, rich push notifications to your users from the AppsOnAir portal. It supports Android, iOS, React Native, and Flutter with a single unified API.
Q: Is Push Notifications free to use?
A: Push Notifications is currently in Beta. Check the AppsOnAir website for the latest pricing details.
Q: What platforms does Push Notifications support?
A: Android (API 24+), iOS (15.0+), React Native (0.71+), and Flutter (3.16.0+).
Q: Is the SDK ready for production?
A: The SDK is currently in Beta. APIs may change without notice. Pin the exact version in your project and avoid using it in production until a stable release is announced.
Credentials & Configuration
Q: What credentials do I need to send push notifications?
A: For Android, a Firebase service account JSON file (from Firebase Console > Project Settings > Service Accounts). For iOS, an APNs Auth Key (.p8) from Apple Developer > Certificates, Identifiers & Profiles > Keys.
Q: Why does AppsOnAir need a Sandbox & Production APNs key?
A: AppsOnAir uses a single key for both development and production delivery. A Sandbox-only or Production-only key will cause push delivery to fail in one environment. This cannot be changed after the key is created in Apple Developer.
Q: Where do I find my App ID and API Key?
A: Go to App Settings > Keys & IDs in the AppsOnAir console. The App ID is used to initialise the SDK. The API Key is used for server-to-server REST API calls only.
Q: Can I download the service account JSON after uploading it?
A: No. The file is stored securely and cannot be downloaded from the console after upload. Keep a local backup.
SDK Integration
Q: Where do I initialise the SDK?
A: As early as possible in your app's lifecycle. For Android/iOS, in Application.onCreate() / AppDelegate. For Flutter, call runApp() first then AppPushService.initialize(). For React Native, call it before or in your root component's useEffect.
Q: Do I need to pass the App ID to initialize()?
A: No. The SDK reads the App ID automatically from AppsonairAppId in AndroidManifest.xml (Android) or Info.plist (iOS). See Getting Started for setup.
Q: Why must AppPushService.initialize(swizzle: false) be called before GeneratedPluginRegistrant.register() in Flutter?
A: Flutter intercepts AppDelegate methods, so the SDK must be initialised before Flutter's plugin registry starts. This ensures kill-mode notification taps (when the app was closed) are captured before Dart starts up.
Q: Does the SDK support both New Architecture and Old Architecture in React Native?
A: Yes. The same JavaScript API works with both Fabric/TurboModules (New Architecture) and the bridge-based Old Architecture.
Permissions & Opt-in
Q: Does the SDK request notification permission automatically?
A: No. You must call requestPermission() explicitly so you can control when and how the prompt appears to your users.
Q: What is the difference between opt-out and revoking OS permission?
A: optOut() stops delivery through AppsOnAir without revoking the OS-level notification permission. The user's device remains registered but receives no notifications until optIn() is called.
Q: How do I check if a user is currently opted in?
A: Call AppPushService.User.pushSubscription.isOptedIn (Flutter/iOS/Android) or AppPushService.user.getOptedIn() (React Native).
Targeting & Segmentation
Q: What targeting options are available when sending a notification?
A: All Subscribed Users, Segment, Filters (tag, language, country, session activity), User ID, and Device ID.
Q: What are tags and how do I use them?
A: Tags are key-value pairs you attach to a device using addTag(). They let you segment users for targeted sends — for example, plan: premium or region: us.
Q: What is the difference between a Segment and Filters?
A: Segments are saved, reusable audiences you build once and target repeatedly. Filters are ad-hoc audiences you build at send time without saving.
Q: How do I target a specific user?
A: Call AppPushService.login('user_id') in the SDK to associate a device with a known user ID. Then target that ID from the console using the User ID audience option.
Rich Notifications & Features
Q: How do I send image attachments in notifications?
A: Set an Image URL (HTTPS) when composing the notification. On iOS, images require the Notification Service Extension (NSE) to be set up — see the iOS SDK Setup guide.
Q: How many action buttons can I add?
A: Up to 4 action buttons per notification, each with a label and optional URL.
Q: Can I suppress notifications while the app is in the foreground?
A: Yes. Use addForegroundWillDisplayListener and call event.preventDefault() to suppress the notification and handle it yourself.
iOS Specific
Q: Why is the Notification Service Extension (NSE) required for iOS images?
A: iOS does not download image attachments unless an NSE intercepts the payload and attaches the media before display. Without it, only the text of the notification is shown.
Q: Can I add the NSE via CocoaPods?
A: No. AppsOnAir-AppPush-ServiceExt must be linked via Swift Package Manager even if your main app uses CocoaPods. Using CocoaPods for the NSE causes Xcode archive to fail with a "Multiple commands produce framework" error.
Q: Do I need an App Group for the NSE?
A: Yes. Add the App Groups capability to both the main app target and the NSE target using the same group identifier, and add AppsOnAirAppGroup to both Info.plist files.
Q: Why is APNs not working on the iOS Simulator?
A: APNs is not supported on the iOS Simulator. Test on a real device.
Android Specific
Q: Why are notifications not showing in the background on Android?
A: Send a data-only FCM payload (no notification block). When a notification block is present, FCM renders the notification itself and bypasses the SDK's handling.
Q: What is the default notification icon requirement?
A: Use a white silhouette on a transparent background in res/drawable, and declare it with the com.appsonair.apppush.default_notification_icon meta-data (plus the Firebase equivalent). Unlike OneSignal, the SDK doesn't pick up an icon by file name. Without the meta-data it falls back to the launcher icon, which shows as a white square. See Notification Icon & Color.
Q: Can I set a custom notification icon on iOS?
A: No. iOS always shows the app icon, and APNs has no field for a notification icon.
Q: Which launchers support badge counts on Android?
A: Badge API via launcher broadcasts is supported on Samsung, MIUI (Xiaomi), and ASUS launchers only.
Delivery Limitations
Q: Why aren't notifications being delivered even though the SDK is set up correctly?
A: Push delivery depends on OS settings, device state, and manufacturer-specific battery management — not just your code. Common causes include Doze mode (Android), Low Power Mode (iOS), battery optimization, or OEM restrictions. See the When Notifications Won't Be Delivered section in your platform's SDK setup guide.
Q: Why aren't silent pushes being delivered on Android?
A: Several conditions block silent (data-only) push delivery on Android: Doze mode suspends background network access; App Standby buckets restrict rarely-used apps; battery optimization delays wake-ups; background data restrictions block FCM on mobile data; and OEM battery managers (Xiaomi, Huawei, Samsung, OPPO) can kill background processes entirely. Users need to set your app to Unrestricted in battery settings and enable Autostart on OEM devices. Also make sure you are sending a data-only FCM payload — if a notification block is present, Firebase renders the notification itself and bypasses the SDK.
Q: Why aren't silent pushes being delivered on iOS?
A: iOS has several OS-level restrictions for silent pushes: Low Power Mode suspends silent push delivery entirely; Background App Refresh must be enabled for the app; if the user swipes the app off the App Switcher (kill mode), iOS will not deliver silent pushes until the app is manually relaunched; Apple rate-limits silent pushes per device per hour; and a low battery level (roughly below 20%) causes iOS to defer background work more aggressively.
Q: Does kill mode affect visible (banner) notifications?
A: No. Kill mode only affects silent (data-only) pushes on iOS. Regular visible notifications are still delivered to a killed app and appear in the notification shade. The user just won't receive silent background wakes until the app is relaunched.
Q: What are OEM battery restrictions and how do they affect push delivery?
A: Manufacturers like Xiaomi (MIUI), Huawei (EMUI), Samsung (One UI), OnePlus, and OPPO (ColorOS) add proprietary battery management on top of stock Android. These can kill background processes and block FCM delivery even for high-priority messages. To fix this, users must enable Autostart and set battery saver to No restrictions for both your app and Google Play services in the device's battery settings.
Q: Does Low Power Mode on iOS affect all notifications?
A: No. Low Power Mode only suspends silent push delivery and Background App Refresh. Visible banner notifications (with an alert payload) are still delivered and displayed normally.
Troubleshooting
Q: The push token never arrives. What should I check?
A: For Android: confirm google-services.json is in android/app/ and the Google Services plugin is applied. For iOS: confirm the Push Notifications capability is added in Xcode Signing & Capabilities and you are testing on a real device.
Q: Kill-mode notification taps are not being handled in Flutter. Why?
A: Ensure AppPushService.initialize(swizzle: false) is called before GeneratedPluginRegistrant.register() in AppDelegate.swift, and that addClickListener is registered after initialize() resolves in Dart.
Q: The NSE is not being invoked on iOS. What should I check?
A: Confirm mutable-content: 1 is set in the APNs payload, and that both the main app and NSE targets share the same App Group identifier.
Q: Xcode archive fails with "Multiple commands produce framework". What is wrong?
A: This happens when the NSE or NCE extension target links the same framework as the main app, causing a conflict at archive time. The fix depends on your package manager:
-
React Native (CocoaPods) — Remove the
AppsOnAir-AppPush/ServiceExtensionorContentExtensionpod from the extension target inios/Podfile. Instead, linkAppsOnAir-AppPush-ServiceExt/AppsOnAir-AppPush-ContentExtvia File → Add Package Dependencies in Xcode (SPM), and update the import inNotificationService.swifttoAppsOnAir_AppPush_ServiceExt. -
Flutter (CocoaPods) — Never add SDK subspecs to the extension targets in
ios/Podfile. Useinherit! :search_pathsonly for the extension targets, and always link extension products via Swift Package Manager in Xcode.
Q: Xcode archive fails with "Multiple commands produce framework" in React Native even after removing the pod. Why?
A: If use_frameworks! is set in your Podfile, CocoaPods may still embed the framework from the main app target into the extension. The safest fix is to link the extension products via SPM (see above) and ensure the extension pod is fully removed and pod install re-run.
Q: Cannot find module error in React Native. What should I do?
A: Run npm install followed by npx pod-install (iOS). Make sure autolinking has completed successfully.
For more information, visit the AppsOnAir website or check out the other Push Notifications documentation pages.