# Troubleshooting

 There's a new version available!

These pages cover version 2 of our SDK, but a newer version is available. In general, we suggest that you update to the latest version to take advantage of new features and fixes.

*   Are you new to our SDKs? [Check out the latest docs.](/integrations/sdk/react-native/getting-started)
*   Otherwise, [learn about updating to the latest version](/integrations/sdk/react-native/whats-new/)

If you’re having trouble with the SDK, here are some basic steps to troubleshoot your problems, and solutions to some known issues.

## Basic troubleshooting steps[](#basic-troubleshooting-steps)

1.  **Update to the latest version**: When troubleshooting problems with our SDKs, we generally recommend that you try updating to the latest version. That helps us weed out issues that might have been seen in previous versions of the SDK.
2.  **Try running our MCP server**: Our MCP server includes an `integration` tool that can provide immediate help with your implementation, including problems with push and in-app notifications. See [Use our MCP server to troubleshoot your implementation](#troubleshoot-with-mcp) below.
3.  **Enable `debug` logging**: Reproducing your issue with `loglevel` set to `debug` can help you (or us) pinpoint problems.
    
     Don’t use debug mode in your production app
    
    Debug mode is great for helping you find problems as you integrate with Customer.io, but we strongly recommend that you set `loglevel` to `error` in your publicly available, production app.
    
4.  **Try our test image**: Using [an image](#image-display-issues) that we know works in push and in-app notifications can help you narrow down problems relating to images in your messages.

### If you need to contact support[](#if-you-need-to-contact-support)

We’re here to help! If you contact us for help with an SDK-related issue, we’ll generally ask for the following information. Having it ready for us can help us solve your problem faster.

1.  **Share information about your device and environment**: Let us know where you had an issue—the SDK and version of the SDK that you’re using, the specific device, operating system, message, use case, and so on. The more information you share with us, the easier it is for us to weed out externalities and find a solution.
    
2.  **Provide comprehensive debug logs**: When sharing logs with our support team, please ensure your logs include:
    
    *   **SDK initialization**: Show that the SDK was initialized with your site ID and API key
    *   **Profile identification**: Show that a profile was identified in your app
    *   **Issue reproduction**: Capture the exact issue you’re experiencing
    *   **Unfiltered logs**: Provide complete, unfiltered logs—don’t remove or filter out any log entries
    *   **Debug level enabled**: Make sure `loglevel` is set to `debug` when capturing logs for support
3.  **For push notification issues**:
    
    *   **Use live push examples**: If your issue relates to push notifications, provide logs from a **live push notification** sent through a campaign or API call, not a test send. Live pushes show the actual payload that was delivered to the profile.
    *   **Test in different app states**: Test and document the issue in various app states:
        *   **Foreground**: App is open and active
        *   **Background**: App is running but not in focus
        *   **Killed/Terminated**: App is completely closed
    *   **Include the push payload**: Share the complete push notification payload that you sent.
4.  **[Grant access to your workspace](/journeys/privacy/#support-team-access)**: It may help us to see exactly what triggers a campaign, what data is associated with devices you’re troubleshooting, etc. You can grant access for a limited time, and revoke access at any time.
    

### Capture logs[](#capture-logs)

Logs help us pinpoint the problem and find a solution.

1.  **Enable debug logging in your app**.
    
     You should not use debug mode in your production app. Remember to disable debug logging before you release your app to the App Store.
    
    ```javascript
    import { CustomerIO, CustomerioConfig, CustomerIOEnv, Region } from 'customerio-reactnative';
    
    const data = new CustomerioConfig()
     
    data.logLevel = CioLogLevel.debug
    
    CustomerIO.initialize(env, data) ;
    ```
    
2.  Build and run your app on a physical device or emulator.
    
3.  In the console, run:
    
    ```fallback
    react-native log-ios
    react-native log-android
    ```
    
4.  Export your log to a text file and send it to our Support team at [win@customer.io](mailto:win@customer.io). In your message, describe your problem and provide relevant information about:
    
    *   The version of the SDK you’re using.
    *   The type of problem you’ve encountered.
    *   An existing GitHub issue URL or existing support email so we know what these log files are in reference to.

## Image display issues[](#image-display-issues)

If you’re having trouble, try using our test image in a message! If it works, then there’s likely a problem with your original image.

[![a test image of a bird that we know will work with all push notifications](https://docs.customer.io/images/push-image-control.jpg)](#880a298d31bff7acc0ac56edbb6a6dc6-lightbox)

Android and iOS devices support different image sizes and formats. In general, you should stick to the smallest size (under 1 MB—the limit for Android devices) and common formats (PNG, JPEG).

iOS

Android

In-App (all platforms)

**Format**

JPEG, PNG, BMP, GIF

JPEG, PNG, BMP

JPEG, PNG, GIF

**Maximum size**

10 MB\*

1 MB

**Maximum resolution**

2048 x 1024 px

1038 x 1038 px

\*For linked media only. If you host images in our Asset Library, you’re limited to 3MB per image.

## Push notification issues[](#push-notification-issues)

### Try updating iOS package dependencies[](#try-updating-ios-package-dependencies)

This SDK uses our iOS push package. In some cases, we may make fixes in our iOS packages that fix downstream issues in, or expose new features to this SDK. You can update the version in your podfile and then run the following command to get the latest iOS packages.

Our instructions above list out the full version of the iOS push package. If you want to automatically increment packages, you can remove the patch and minor build numbers (the second and third parts of the version number), and `pod update` will automatically fetch the latest package versions. However, please understand that fetching the latest versions can cause build issues if the latest iOS package doesn’t agree with code in your app!

```shell
pod update --repo-update --project-directory=ios
```

### Why didn’t everybody in my segment get a push notification?[](#why-didnt-everybody-in-my-segment-get-a-push-notification)

If your [segmentA group of people who match a series of conditions. People enter and exit the segment automatically when they match or stop matching conditions.](/journeys/data-driven-segments/) doesn’t specify people who have an existing device, it’s likely that people entered your segment without using your app. If you send a push notification to such a segment, the “Sent” count will probably show fewer sends than there were people in your segment.

### Why are messages sent but not delivered or opened?[](#why-are-messages-sent-but-not-delivered-or-opened)

The *sent* status means that we sent a message to your delivery provider—APNS or FCM. It’ll be marked *delivered* or *opened* when the delivery provider forwards the message to the device and the SDK reports the metric back to Customer.io. If a person turned their device off or put it in airplane mode, they won’t receive your push notification until they’re back on a network.

 Make sure you’ve configured your app to track metrics

If your app isn’t set up to capture push metrics, your app will *never* report `delivered` or `opened` metrics!

### Why don’t my messages play sounds?[](#why-dont-my-messages-play-sounds)

When you send a push notification to iOS devices that uses our SDK, you can opt to send the *Default* system sound or no sound at all. If your audience’s phone is set to vibrate, or they’ve disabled sound permissions for your app, the *Default* setting will cause the device to vibrate rather than playing a sound.

In most cases, you should use the *Default* sound setting to make sure your audience hears (or feels) your message. But, before you send sound, you should understand:

1.  Your app needs permission from your users to play sounds. This is done by your app, not our SDKs. [Here’s an example from our iOS sample app](https://github.com/customerio/customerio-ios/blob/main/Apps/APN-UIKit/APN%20UIKit/Util/NotificationUtil.swift#L12-L13) showing how to request sound permissions.
2.  iOS users can go into *System Settings* and disable sound permissions for your app. Enabling the *Default* setting doesn’t guarantee that your audience hears a sound when your message is delivered!

 We don’t support custom sounds yet

If you want to send a custom sound, you’ll need to handle it on your own, outside the SDK and use a custom payload when you set up your push notifications.

### FCM `SENDER_ID_MISMATCH` error[](#fcm-sender_id_mismatch-error)

This error occurs when the FCM Sender ID in your app does not match the Sender ID in your Firebase project. To resolve this issue, you’ll need to ensure that the Sender ID in your app matches the Sender ID in your Firebase project.

1.  Check that you uploaded the correct JSON certificate to Customer.io. If your JSON certificate represents the wrong Firebase project, you may see this error.
2.  Verify that the Sender ID in your app matches the Sender ID in your Firebase project.
3.  If you imported devices (device tokens) from a previous project, make sure that you imported tokens from the correct Firebase project. If the tokens represent a different app than the one you send push notifications to, you’ll see this error.

### Error: Initializer element is not a compile-time constant[](#error-initializer-element-is-not-a-compile-time-constant)

If you get this error while initializing the object in `AppDelegate`, go to your project’s `ios` directory, open `AppDelegate.m` and update the object of your `amiappPushNotificationsHandler`—or however you named your push handler—with the following code.

```Objective-C
@implementation AppDelegate
PushNotificationsHandler* pnHandlerObj = nil;
+ (void)initialize {
  pnHandlerObj = [[amiappPushNotificationsHandler alloc] init];
}
```

### Deep linking to iOS when your app is closed[](#troubleshoot-ios-deep-links)

There’s a known issue preventing deep links from working when your app is closed on iOS devices. When the app is closed, the native click event is fired before the react app’s lifecycle starts. We recommend a two-step workaround:

1.  Add an additional, custom parameter in your push payload, like **react-deep-link** in the example below. We can use this field in step 2.
    
    ```json
     {
       "CIO": {
         "push": {
           "image": "[https://thumbs.dreamstime.com/b/bee-flower-27533578.jpg](https://thumbs.dreamstime.com/b/bee-flower-27533578.jpg)",
           "link": "amiapp://showtrial"
         }
       },
       "react-deep-link": "amiapp://showtrial",
       "aps": {
         "mutable-content": 1,
         "sound": "default",
         "alert": {
           "title": "Voila! You just logged in as a user",
           "sound": "default",
           "body": "Thanks for using the app."
         }
       }
     }
    ```
    
2.  Update `didFinishLaunchingWithOptions` in your `AppDelegate.m` file with the code below. We use the variable `modifiedLaunchOptions` to create a bridge object in the last line of this code, which grabs the link and sends users to the specified screen.
    
    ```Objective-C
     NSMutableDictionary *modifiedLaunchOptions = [NSMutableDictionary dictionaryWithDictionary:launchOptions];
       if (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]) {
           NSDictionary *pushContent = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];
           if (pushContent[@"react-deep-link"]) {
               NSString *initialURL = pushContent[@"react-deep-link"];
               if (!launchOptions[UIApplicationLaunchOptionsURLKey]) {
                   modifiedLaunchOptions[UIApplicationLaunchOptionsURLKey] = [NSURL URLWithString:initialURL];
               }
           }
       }
    
     // Replace `launchOptions` with `modifiedLaunchOptions` 
     RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:modifiedLaunchOptions];
     ...
     // Use the `bridge` object in `RCTAppSetupDefaultRootView`
     UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"SampleApp", initProps, true);
    ```
    

### Compiler error: ‘X’ is unavailable in application extensions for iOS[](#compiler-error-x-is-unavailable-in-application-extensions-for-ios)

This error occasionally occurs when users add a notification extension to handle rich push messages. If you see this error, try the following steps:

1.  Add this code to the end of your `Podfile`:
    
    ```ruby
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        if target.name.start_with?('CustomerIO')
          puts "Modifying target #{target.name} with workaround"
    
          target.build_configurations.each do |config|
            puts "Setting build config settings for #{target.name}"
            config.build_settings['APPLICATION_EXTENSION_API_ONLY'] ||= 'NO'
          end
        end
      end
    end
    ```
    
2.  In the root directory of your app, run `pod install --project-directory=ios`. This command will apply the above workaround to your project.
    
3.  Try to compile your app again.
    

*If you still see the error message*, it’s likely that the error you see is related to a different SDK that you use in your app and not the Customer.io SDK. We suggest that you contact the developers of the SDK that you see in the error message for help.

*If you don’t see an error message*, [send our technical support team a message](mailto:win@customer.io) with:

*   The error message that you see when compiling your app.
*   The contents of your `ios/Podfile` and `ios/Podfile.lock` files.
*   The version of the React Native SDK that you are using.

### Deep links on iOS only open in a browser[](#deep-links-on-ios-only-open-in-a-browser)

It sounds like you want to use [universal links](/universal-links/#deep-links-vs-universal-links)—links that go to your app if a person has your app installed and to your website if they don’t. Universal links are a bit different than your average deep link and require a little bit of additional setup.

## In-App message issues[](#in-app-message-issues)

### My in-app messages are sent but not delivered[](#my-in-app-messages-are-sent-but-not-delivered)

People won’t get your message until they open your app. If you use page rules, they won’t see your message until they visit the right screen(s), so delivery times for in-app messages can vary significantly from other types of messages.