Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Get deeplink URL from launch intent. Works around #3066 #3067

Merged
merged 1 commit into from
Mar 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,26 @@ void loadFromIntent(final Intent intent) {
Log.e(LOGTAG,"Loading from crash Intent");
}

// FIXME https://github.com/MozillaReality/FirefoxReality/issues/3066
if (DeviceType.isOculusBuild()) {
Bundle bundle = intent.getExtras();
if (bundle != null) {
String cmd = (String) bundle.get("intent_cmd");
if ((cmd != null) && (cmd.length() > 0)) {
try {
JSONObject object = new JSONObject(cmd);
JSONObject launch = object.getJSONObject("ovr_social_launch");
String msg = launch.getString("deeplink_message");
Log.d(LOGTAG, "deeplink message: " + msg);
onAppLink(msg);
return;
} catch (Exception ex) {
Log.e(LOGTAG, "Error parsing deeplink JSON: " + ex.toString());
}
}
}
}

Uri uri = intent.getData();

boolean openInWindow = false;
Expand Down
12 changes: 8 additions & 4 deletions app/src/oculusvr/cpp/DeviceDelegateOculusVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,14 @@ DeviceDelegateOculusVR::ProcessEvents() {
}
break;
case ovrMessage_Notification_ApplicationLifecycle_LaunchIntentChanged: {
auto details = ovr_ApplicationLifecycle_GetLaunchDetails();
const char *msg = ovr_LaunchDetails_GetDeeplinkMessage(details);
if (msg) {
VRBrowser::OnAppLink(msg);
ovrLaunchDetailsHandle details = ovr_ApplicationLifecycle_GetLaunchDetails();
if (ovr_LaunchDetails_GetLaunchType(details) == ovrLaunchType_Deeplink) {
const char* msg = ovr_LaunchDetails_GetDeeplinkMessage(details);
if (msg) {
// FIXME see https://github.com/MozillaReality/FirefoxReality/issues/3066
// Currently handled in VRBrowserActivity.loadFromIntent()
// VRBrowser::OnAppLink(msg);
}
}
break;
}
Expand Down