Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean onNotificationClicked(FlurryMessage flurryMessage) {
- // NOTE: THIS METHOD WILL ONLY BE CALLED IF FLURRY HANDLED onNotificationReceived callback
- // determine if you'd like to handle the clicked notification yourself or not
- boolean handled = false;
- // see if notification contains deeplink
- if (flurryMessage.getAppData() != null && flurryMessage.getAppData().containsKey("deeplink")) {
- String deeplink = flurryMessage.getAppData().get("deeplink");
- // create the Intent
- final Intent deeplinkIntent = new Intent(Intent.ACTION_VIEW);
- deeplinkIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- deeplinkIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- // set the data using your deeplink
- deeplinkIntent.setData(Uri.parse(deeplink));
- // add the FlurryMessage to extras
- FlurryMessaging.addFlurryMessageToIntentExtras(deeplinkIntent, flurryMessage);
- // make sure the deeplink resolves to an activity, then open it
- if (deeplinkIntent.resolveActivity(context.getPackageManager()) != null) {
- context.startActivity(deeplinkIntent);
- // tell flurry you've handled the notification
- handled = true;
- }
- }
- return handled;
- }
Add Comment
Please, Sign In to add comment