Skip to content

Instantly share code, notes, and snippets.

@Override
public void onTokenRefresh() {
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
FlurryMessaging.setToken(refreshedToken);
}
FlurryMarketingOptions flurryMessagingOptions = new FlurryMarketingOptions.Builder()
.setupMessagingWithManualIntegration(token)
.withDefaultNotificationChannelId(NOTIFICATION_CHANNEL_ID)
.withDefaultNotificationIconResourceId(R.drawable.ic_notification)
.withDefaultNotificationIconAccentColor(getResources().getColor(R.color.notification_icon_background))
String token = FirebaseInstanceId.getInstance().getToken();
new FlurryAgent.Builder()
...
.withModule(marketingModule)
...
.build(context, FLURRY_API_KEY);
FlurryMarketingModule marketingModule = new FlurryMarketingModule(flurryMessagingOptions);
FlurryMessagingListener myFlurryMessagingListener = new MyFlurryMessagingListener(context);
FlurryMarketingOptions flurryMessagingOptions = new FlurryMarketingOptions.Builder()
.setupMessagingWithAutoIntegration()
.withDefaultNotificationChannelId(NOTIFICATION_CHANNEL_ID)
.withDefaultNotificationIconResourceId(R.drawable.ic_notification)
public class MyFlurryMessagingListener implements FlurryMessagingListener {
final static String LOG_TAG = MyFlurryMessagingListener.class.getCanonicalName();
Context context;
public MyFlurryMessagingListener(Context context) {
this.context = context;
//replace X.Y.Z with the latest version of the Firebase Messaging version
//The latest version supported by Flurry Push is 21.1.0
implementation ‘com.google.firebase:firebase-messaging:X.Y.Z’
//replace X.Y.Z with the latest version of the Flurry SDK version
//Flurry SDK versions availble at https://developer.yahoo.com/flurry/docs/releasenotes/android/
implementation “com.flurry.android:marketing:X.Y.Z”
// required to use flurry marketing
implementation “com.flurry.android:analytics:X.Y.Z”
// Set up your regular ViewBinder
ViewBinder binder = new ViewBinder.Builder(R.layout.native_ad_list_item)
.titleId(R.id.native_title)
.textId(R.id.native_text)
.mainImageId(R.id.native_main_image)
.iconImageId(R.id.native_icon_image)
.callToActionId(R.id.native_cta)
.privacyInformationIconImageId(R.id.native_privacy_information_icon_image)
.build();