Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: API 30+ fix for opening Pinpoint push notification links #2924

Merged
merged 4 commits into from Jun 8, 2022

Conversation

tylerjroach
Copy link
Contributor

Description of changes:
Android 30+ no longer allows you to query packages without adding a query tag in the manifest. Rather than add that tag, a more simple approach is to go ahead and try to start an activity and catch the exception.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@tylerjroach tylerjroach requested a review from a team as a code owner June 8, 2022 13:07
sdhuka
sdhuka previously approved these changes Jun 8, 2022
pinpointContext.getApplicationContext().startActivity(intent);
} catch (ActivityNotFoundException e) {
log.error("Couldn't find an app to open ACTION_VIEW Intent.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we include e or e.getMessage for additional context on error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can, but it won't really provide any additional context. In this instance the only scenario here is that the user does not have a browser app installed.

Copy link
Member

@sktimalsina sktimalsina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except minor question.

sktimalsina
sktimalsina previously approved these changes Jun 8, 2022
@tylerjroach tylerjroach dismissed stale reviews from sktimalsina and sdhuka via 0599d5c June 8, 2022 15:03
@tylerjroach tylerjroach changed the title API 30+ fix for opening Pinpoint push notification links Fix: API 30+ fix for opening Pinpoint push notification links Jun 8, 2022
@tylerjroach tylerjroach merged commit f34d1e7 into main Jun 8, 2022
@tylerjroach tylerjroach deleted the tjroach/fix-open-push-url-sdk30 branch June 8, 2022 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants