Skip to content

Commit

Permalink
Merge pull request #242 from PravinPK/fix_OpenURl
Browse files Browse the repository at this point in the history
Bug Fix: Opening deeplink refreshes home page state
  • Loading branch information
PravinPK authored Mar 14, 2024
2 parents 842702c + 5499853 commit 0eb194b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions code/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mavenUploadDryRunFlag=false
# production versions for production build
mavenCoreVersion=3.0.0-beta.1-SNAPSHOT

functionalTestEdgeIdentityVersion=3.0.0-SNAPSHOT
functionalTestEdgeVersion=3.0.0-SNAPSHOT
functionalTestEdgeIdentityVersion=3.0.0-beta.1-SNAPSHOT
functionalTestEdgeVersion=3.0.0-beta.1-SNAPSHOT
functionalTestLifecycleVersion=3.0.0-beta.1-SNAPSHOT
functionalTestAssuranceVersion=3.0.0-beta.1-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.adobe.marketing.mobile.messaging;
import android.app.Activity;
import android.app.NotificationManager;
import android.app.TaskStackBuilder;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

import androidx.annotation.Nullable;

import com.adobe.marketing.mobile.Messaging;
Expand Down Expand Up @@ -134,9 +135,11 @@ private void openApplication() {
* @param uri the uri to open
*/
private void openUri(final String uri) {
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
stackBuilder.addNextIntentWithParentStack(intent);
stackBuilder.startActivities();
try {
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(intent);
} catch (ActivityNotFoundException e) {
Log.warning(MessagingPushConstants.LOG_TAG, SELF_TAG, "Unable to open the URI from the notification interaction. URI: %s", uri);
}
}
}

0 comments on commit 0eb194b

Please sign in to comment.