flurry / react-native-flurry-sdk

React Native Flurry SDK
Apache License 2.0
45 stars 13 forks source link

Android icon missing #27

Closed GopalAdappt closed 3 years ago

GopalAdappt commented 4 years ago

We are facing some issues in Android regarding receiving notification icon is in Grey box to a specific device module as mentioned below.

package.json “react": "16.8.3", "react-native": "0.59.10", "react-native-flurry-sdk": "^6.0.9"

Devices

  1. Lenovo Model: A7010a48 OS: 6

  2. Redmi Model: RedmiNote 5 Pro OS: 9 A7010a48

poting-oath commented 4 years ago

This is a feature we already resolved in https://github.com/flurry/react-native-flurry-sdk/issues/7.

When you initialize Flurry Messaging, you can specify your FlurryMarketingOptions. Inside your FlurryMarketingOptions, you can define your notification icon there.

Please check our README,

.withMessaging(true, options_or_listener) // optional user's native `FlurryMarketingOptions` or `FlurryMessagingListener`. 

I.e.,

  1. Add the following dependency in your android's build.gradle:
    implementation 'com.flurry.android:marketing:12.9.0'
  2. Import FlurryMarketingOptions in your MainApplication:
    import com.flurry.android.marketing.FlurryMarketingOptions;
  3. Define your FlurryMarketingOptions with the icon you want to show:
    FlurryMarketingOptions messagingOptions = new FlurryMarketingOptions.Builder()
           .setupMessagingWithAutoIntegration()
           .withDefaultNotificationIconResourceId(R.mipmap.ic_launcher_round)   // your icon here.
           // Define more if needed
           // .withDefaultNotificationChannelId(NOTIFICATION_CHANNEL_ID)
           // .withDefaultNotificationIconAccentColor(getResources().getColor(R.color.colorPrimary))
           // .withFlurryMessagingListener(messagingListener)
           .build();
  4. Finally enable Flurry Messaging with your options:
    new FlurryModule.Builder()
              .withLogEnabled(true)
              .withLogLevel(Log.VERBOSE)
              .withMessaging(true, messagingOptions)
              .build(this, YOUR_APK_KEY);   
poting-oath commented 4 years ago

If the above approach does not resolve your issue, means your Android icon resource is not available for the specific devices.

I.e., your Android resources probably does not give a general definition of this icon.

All of the approach are pure Android codes. Please check your icon Android resources.

poting-oath commented 3 years ago

@GopalAdappt Do you resolve your app icon issue by checking the icon resources? Thanks!

poting-oath commented 3 years ago

Close it as the complete steps to set Messaging is described in the React Native Tutorial. https://github.com/flurry/React-Native-Tutorial#users-native-flurry-push-options-or-listener