Comments (11)
@MohamadKh75 I just published a release with the fix (1.1.0
).
To handle deep linking, you have to:
- Add
android:launchMode="singleTask"
on yourMainActivity
- Add
android:launchMode="singleTask"
on yourRNBootSplashActivity
- Add the deep linking
<intent-filter>
inside theRNBootSplashActivity
For you, it will be:
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="true"
android:launchMode="singleTask" />
<!-- Splash Screen -->
<activity
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
android:theme="@style/BootTheme"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Deep Linking -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="aramesh" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
Can you try and confirm that everything is OK? Thanks!
from react-native-bootsplash.
Yep! Everything is OK 🎉
Tnx ❤️
I'll create a PR to add this to readme 😁
from react-native-bootsplash.
@paolospag Yes! Android has some debug tools to test deeplinks, give it a try
from react-native-bootsplash.
When your app the first time, it open with RNBootSplashActivity
then MainActivity
. The RNBootSplashActivity
will pass all extras intents to your MainActivity
, and starts it.
When you reload your app, the active Activity is already MainActivity
, which can receive aramesh
links according to your manifest.
Try adding the intent-filter to the splash screen activity too.
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="true"
android:launchMode="singleTask">
<!-- Deep Linking -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="aramesh" />
</intent-filter>
</activity>
<!-- Splash Screen -->
<activity
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
android:theme="@style/BootTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Deep Linking -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="aramesh" />
</intent-filter>
</activity>
from react-native-bootsplash.
Tnx for your reply.
Unfortunately, the problem exist 😐
I edited manifest and rebuild. Now when i click on the button with link of aramesh://agent/2
android gives me two options (Both are my app with same package name) and both of them don't load the Landing
page. (As you can see, i added the path: 'agent/:personID'
to my router!
Now i don't get data even after reload! So i guess i should put the filter only in splash...
But how can i pass data to the main activity?
I even can't route to any screen! (Maybe it is React-Navigation's bug)
I followed this doc so, am i missing something? Or is this a bug?
from react-native-bootsplash.
I had the same problem in the recent days and this annotation seems to have solved it, but what about usage with notifications' modules?
E.g., integrating RN Firebase Notifications (v5.6.0) and following the documentation for Android, it requires singleTop
instead of singleTask
launch mode.
So what needs to be done in these cases?
from react-native-bootsplash.
If I refer to https://inthecheesefactory.com/blog/understand-android-activity-launchmode/en, singleTop could be used as well (on both Activity). But I would recommend keeping singleTask
on the BootSplash one
from react-native-bootsplash.
So, the code should be:
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="true"
android:launchMode="singleTop" /> <!-- change this for Notifications support -->
<!-- Splash Screen -->
<activity
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
android:theme="@style/BootTheme"
android:launchMode="singleTask"> <!-- maintain on singleTask for Bootsplash -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="aramesh" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
Is it correct?
from react-native-bootsplash.
@MohamadKh75 I just published a release with the fix (
1.1.0
).
@zoontek
Hello, I am getting an error like this, where am I going wrong
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true">
</activity>
<!-- Splash Screen -->
<activity
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
android:theme="@style/BootTheme"
android:launchMode="singleTask">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<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="---" />
<data android:scheme="https" android:host="---" />
</intent-filter>
</activity>
</application>
Error Message
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
my build gradle
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 23
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://www.jitpack.io' }
}
}
from react-native-bootsplash.
@enverkoselertr Just follow the error message…This is not a library issue.
<activity
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
android:theme="@style/BootTheme"
android:launchMode="singleTask"
android:exported="true"><!-- add this line -->
Please consider a one time sponsorship, because by mentioning me explicitly you bothered me in my personal life. Open source is not free products by folks working for you, willing to help at any time.
And if you don't want to support a free library and the people behind it, next time ask for help elsewhere.
from react-native-bootsplash.
Thank you very much for your answer. I've never thought of it this way. I am so sorry for my thoughtlessness. I will do what is necessary, have a nice day
from react-native-bootsplash.
Related Issues (20)
- Bug when assembleeRelease HOT 1
- iOS error during debug scheme starting HOT 2
- How can i show code push progress bar in splash screen? HOT 1
- Output/Document need to manually create missing images HOT 1
- Default Android system splashscreen appears before my custom splashscreen HOT 1
- Add option to use system scheme instead of scheme returned by useColorScheme in useHideAnimation HOT 6
- 我在屏幕中间放一个logo,我还需要在屏幕底部放些文字,要怎么做呢?
- Add plugin for nx HOT 1
- splash icon disappeared in android HOT 3
- Adding android:windowBackground causes it to appear after original splash hides HOT 3
- Generated background has incorrect color HOT 6
- Generate splashscreen HOT 1
- iOS: building failed with RN 0.73 and new arch enabled HOT 3
- RN 0.74 - How to avoid `createRootViewWithBridge` HOT 1
- Small icon size on Samsung devices with Android 12 HOT 3
- Expo config plugin overrides AppDelegate imports from other plugins HOT 8
- circle in the center at the beginning of the splash screen display (android) HOT 1
- iOS crashes with react native 0.74 without new arch HOT 2
- Android app does not launch automatically in debug mode HOT 2
- No visible @interface for 'RNNAppDelegate' declares the selector 'createRootViewWithBridge:moduleName:initProps:' HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-bootsplash.