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)
- 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
- [Expo - iOS] react-native 0.74.3 breaks the splash screen HOT 9
- RNBootSplashSpec.h:15:2 This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. HOT 10
- IOS ignores fade: true HOT 2
- White Blink with React Native 0.73.8 HOT 7
- App Development build fails on EAS HOT 12
- Ability to specify whether the project is bare or expo HOT 1
- After upgrading to v6, images aren't updating in native folders HOT 5
- NullPointerException Error: RNBootSplashDialog.dismiss(java.lang.Runnable) HOT 7
- useHideAnimation dosent start animation on release, but works on debug mode HOT 12
- App crashing at startup HOT 1
- Expo Bare Workflow - Android Splash is hiding immediatley HOT 5
- Splash Screen not Hiding in Android HOT 1
- pre-build no longer works after installing bootsplash - expo SDK51 HOT 12
- Android resource linking failed error: resource style/Theme.BootSplash HOT 1
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.