3

I've had an annoying problem with my app for days. It is a React Native App for Android and iOS. The app receives push notifications, which are sent via the Pinpoint API using a lambda function. Almost everything works as desired, except the design of the push notifications. I followed the Amplify instructions to set up the app: https://aws-amplify.github.io/docs/js/push-notifications. If I send a message directly from Pinpoint to my app, I have the possibility to attach Media Urls (pictures), which should be displayed as I understood it in the Push Notification. But they won't... Could anyone PLEASE help me with my problem?

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.notificationapp">

    <uses-permission android:name="android.permission.INTERNET"/>

    <application
            android:name=".MainApplication"
            android:label="@string/app_name"
            android:icon="@mipmap/notificationapp_icon"
            android:roundIcon="@mipmap/notificationapp_icon_round"
            android:allowBackup="false"
            android:theme="@style/AppTheme">

        <service android:name="com.amazonaws.amplify.pushnotification.RNPushNotificationMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT"/>
            </intent-filter>
        </service>
        <!-- [END firebase_service] -->
        <!-- [START firebase_iid_service] -->
        <service android:name="com.amazonaws.amplify.pushnotification.RNPushNotificationDeviceIDService">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
            </intent-filter>
        </service>
        <receiver android:name="com.amazonaws.amplify.pushnotification.modules.RNPushNotificationBroadcastReceiver"
                  android:exported="false">
            <intent-filter>
                <action android:name="com.amazonaws.amplify.pushnotification.NOTIFICATION_OPENED"/>
            </intent-filter>
        </receiver>

        <activity
                android:name=".MainActivity"
                android:label="@string/app_name"
                android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
                android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
    </application>

</manifest>

If you need more information just ask. Thank you in advance!

EDIT:

If i send push notifications via lambda (SendUsersMessages) and append the following GCMMessage Object, ImageUrl and SmallImageIconUrl are ignored and not showing in the notification.

GCMMessage: {
    IconReference: 'ic_stat_warning',
    Action: 'OPEN_APP',
    Title: row.userAssetId+", ID: "+row.title,
    SilentPush: false,
    Body: row.body,
    ImageUrl: 'https://cdn4.iconfinder.com/data/icons/8-bit/160/bit-12-512.png',
    SmallImageIconUrl: 'https://cdn4.iconfinder.com/data/icons/8-bit/160/bit-12-512.png'
}
MattRock
  • 31
  • 3

0 Answers0