Skip to content

Suggestion - documentation update #1041

Closed
@BTrottAtWork

Description

@BTrottAtWork

A helpful tip for android implementation if your react-native activity is not the same activity as the activity designated as your launch activity is to make sure you forward your intent extras to the activity that runs your react-native bundle.

A good example is if your launch activity is a splash screen which then sends the user to your MainActivity, which runs your react-native bundle. In this case you will need to send your splash activity's intent extras to your Main Activity's intent or react-native-notifications will not have access to the notification payload via the getInitialNotification function, so things like deep linking will not be possible.

Example:

 <activity
            android:name=".SplashActivity"
            android:theme="@style/SplashTheme"
            android:label="@string/app_name"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
                <action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
            </intent-filter>
        </activity>

onCreate of SplashActivity:

        Intent intent = new Intent(this, MainActivity.class);
        intent.putExtras(this.getIntent());
        startActivity(intent);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions