Skip to content
Open
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
11 changes: 9 additions & 2 deletions mobile/android/qt6/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,20 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<meta-data
<meta-data
android:name="android.app.lib_name"
android:value="@string/app_name" />

<meta-data
<meta-data
android:name="android.app.arguments"
android:value="" />

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="status-app" />
</intent-filter>
</activity>

<provider
Expand Down
35 changes: 35 additions & 0 deletions mobile/android/qt6/src/app/status/mobile/StatusQtActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.os.Bundle;
import androidx.core.splashscreen.SplashScreen;
import java.util.concurrent.atomic.AtomicBoolean;
import android.content.Intent;
import android.net.Uri;

public class StatusQtActivity extends QtActivity {
private static final AtomicBoolean splashShouldHide = new AtomicBoolean(false);
Expand All @@ -13,6 +15,12 @@ public class StatusQtActivity extends QtActivity {
// Remove this line when Qt 6.10+ fixes the issue, and delete Android16KeyboardWorkaround.java
private Android16KeyboardWorkaround mKeyboardWorkaround;

private static final AtomicBoolean userLoggedIn = new AtomicBoolean(false);
private static String savedDeepLink = null;

// JNI hook: implemented in native code to forward deep links to Qt
private static native void passDeepLinkToQt(String deepLink);

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -25,6 +33,15 @@ public void onCreate(Bundle savedInstanceState) {
// QTBUG-140897: Install Android 16 keyboard workaround
// Remove this line when Qt 6.10+ fixes the issue
mKeyboardWorkaround = Android16KeyboardWorkaround.install(this);

handleDeepLink(getIntent());
}

@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
handleDeepLink(intent);
}

@Override
Expand All @@ -42,5 +59,23 @@ protected void onDestroy() {
// Called from Qt via JNI when main window is visible
public static void hideSplashScreen() {
splashShouldHide.set(true);
userLoggedIn.set(true);
if (savedDeepLink != null) {
passDeepLinkToQt(savedDeepLink);
savedDeepLink = null;
}
}

private void handleDeepLink(Intent intent) {
if (intent == null) return;
String action = intent.getAction();
Uri data = intent.getData();
if (Intent.ACTION_VIEW.equals(action) && data != null) {
if (!userLoggedIn.get()) {
savedDeepLink = data.toString();
return;
}
passDeepLinkToQt(data.toString());
}
}
}
1 change: 1 addition & 0 deletions src/nim_status_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ proc mainProc() =

let singleInstance = newSingleInstance($toMD5(DATADIR), openUri)
let urlSchemeEvent = newStatusUrlSchemeEventObject()
urlSchemeEvent.setInstance()
# init url manager before app controller
statusFoundation.initUrlSchemeManager(urlSchemeEvent, singleInstance, openUri)

Expand Down
2 changes: 1 addition & 1 deletion vendor/nimqml