Can't Open My App in Production | DeepLink React Native | React Navigation v5/v6 - react-native

hope you guys have a great day!
I'm in the middle of learning deeplink in react native, currently I've managed to open my app via cmd using npx uri-scheme open myapp://inv/12321312 --android, and the page I'm going to is also already open along with the :id I included in the link
now i have released my app (not yet uploaded in playstore - but just run npx react-native run-android --variant=release), then why when i access myapp://inv/12321312 link in my browser, my app doesn't open?
i'm using Google Chrome in my android device
please help:(

in app.json add intentFilters for android
if you are using expo
{
"expo": {
"scheme": "myapp",
.....
"android": {
...
"intentFilters": [
{
"action": "VIEW",
"autoVerify": true,
"data": [
{
"scheme": "https",
"host": "myapp.com",
"pathPrefix": "/"
},
{
"scheme": "myapp",
"host": "*",
"pathPrefix": "/"
}
],
"category": [
"BROWSABLE",
"DEFAULT"
]
}
]
...
},
}
}
or if you are using react native CLI
https://developer.android.com/training/app-links/deep-linking#adding-filters
after that generate APK for Android
and send https://myapp.com/ in message whatsapp
click this link from chat
it's work ^^
update : (test)
ios => after build ipa for test ios run this link in your browser phone when app installed : myapp://
android => after build apk for test android send in this link in message (email , whatsapp, ...) and click link for test (after installed app)

Related

Onesignal Expo SDK Setup Google Android FCM Configuration, cannot read property 'smallIcons' of undefined at withSmallIcons (\withOneSignalAndroid.js)

I'm using Onesignal for push notifications but am stuck in an error and could not find the solution for many days.
OneSignal SDK Configuration:
I configured the Google Android (FCM) Configuration with Firebase Server Key and Firebase Sender ID at Onesignal and selected the React Native/Expo SDK and copied the APP ID.
Expo SDK Setup:
I have Expo Managed Workflow so I run the command
expo install onesignal-expo-plugin
then I executed the command
yarn add react-native-onesignal
Added the below code into App.json
{ "plugins": [
"onesignal-expo-plugin",
{
"mode": "development",
}] }
After that import react-native-onesignal and used APP ID in useEffect into reuqired JS
import OneSignal from 'react-native-onesignal';
useEffect(() => {
OneSignal.setAppId("Pasted Copied APP ID here"); }, []);
After that Run the Command
expo prebuild
but getting error
TypeError: Cannot read property 'smallIcons' of undefinedn at withSmallIcons (\node_modules\onesignal-expo-plugin\build\onesignal\withOneSignalAndroid.js)
now getting this error on all console commands related to this react-native project.
I configured Onesignal through the below documentation
https://documentation.onesignal.com/docs/react-native-expo-sdk-setup
I solved it.
actually, the error was occurring in the below code
"plugins": [
"onesignal-expo-plugin",
{
"mode": "development"
}
]
adding the extra Square brackets [ ] solved the "Cannot read property 'smallIcons' of undefined" problem
"plugins": [
[
"onesignal-expo-plugin",
{
"mode": "development"
}
]
]

iOS Dir Not Found (but it exists) and React Native Config shows settings as null

I wanted to test my react native project on iOS (my app works correctly for Android). I do have an iOS folder in my project directory, but I never did anything for iOS in the past. While I was on 0.59, I have since upgraded successfully to React 0.69 and it runs in Android again. Now I would like to try iOS and I typed
react-native run-ios
and the output was:
error iOS project folder not found. Are you sure this is a React Native project?.
The thing is, there is an iOS folder, and lots of files in there as well. After some investigation, I believe my configuration is not setup right. I typed the following command:
react-native config
And here is a snippet of that output.
"healthChecks": [],
"platforms": {
"ios": {},
"android": {}
},
"project": {
"ios": null,
"android": {
"sourceDir": "<my path is here and valid>",
"appName": "app",
"packageName": "com.sensebot"
}
}
I would imagine the fact ios is null is the problem! Why is this null, and how do I configure it? I read you can override this configuration with a react native config file. I don't have one in my directory. Do I need that? If not, where do I configure this, and how is it that it was configured correctly for Android, but not iOS?
Thank you in advance for any help!

React native Expo Build Number does not Increase

I am trying to build version "1.2.0" i have changed every single "buildNumber" and "version" in app.json and expo still builds ios buildNumber: "1.0.0". I am using
eas build --profile production --platform ios
{
"expo": {
"name": "Redacted",
"slug": "Redacted",
"description":"Redacted",
"version": "1.2.0",
"orientation": "portrait",
"icon": "./assets/mark.png",
"splash": {
"image": "./assets/TRANSPARENT2.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"buildNumber": "1.2",
"infoPlist": {
"NSFaceIDUsageDescription": "This app uses the FaceID feature to login. If faceID fails or if it is not available for any reason, the app will fall back to a standard login system."
}
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
},
"permissions": [
"CAMERA",
"USE_FINGERPRINT",
"USE_BIOMETRIC",
"VIBRATE"
],
"package": "Redacted"
},
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": [
[
"expo-notifications",
{
"icon": "./assets/DarkVersion.png",
"color": "#d2282e",
"sounds": [
"./assets/notification.m4r"
]
}
]
]
}
}
This is what i get on expo.dev...I cant submit the app because of this.
And here is the error in the console.
Same Experience
I had a similar experience updating the app.json file in my-expo-project.
I kept the version string the same 0.9.9 and only changed the build number string from 124 to 125.
Running eas build --profile production --platform iOS resulted in the same console error.
You've already submitted this version of the app.
The build summary on expo.dev showed the old build number was delivered.
Solution
Turns out I had to use the expo prebuild command to resolve this.
➜ my-expo-project git:(v125) $ expo prebuild
✔ Created native projects | /android, /ios already created | gitignore already synced
✔ Updated package.json and added index.js entry point for iOS and Android
📦 Using npm to install packages.
✔ Cleaned JavaScript dependencies 3698ms
✔ Installed JavaScript dependencies 11150ms
✔ Config synced
Now that the app config is synced to the ./iOS and ./Android folders eas build --profile production --platform iOS now delivers the correct bundle and build number to expo.dev
Turns out eas build --profile production --platform ios does not update the plist file every time you run it (super lame IMO). You manually need to go into the ./ios/<yourApp>/plist file and update the CFBundleVersion and CFBundleShortVersionString keys. This is only a thing after your first run of eas build --profile production --platform ios
If you do not have any native code or have not updated native code inside the ios or android folder, you can delete the folders and let EAS handle the builds for you. Without those folders, eas build -p ios with or without --local will update the build numbers from the app.json file.
If you want to keep the ios and android folders, you'll have to run npx expo prebuild as #L4ivi suggested or you can update the version going into ios > info.plist file and update the string value of CFBundleShortVersionString for your version number and CFBundleVersion for your build number. Or you can open the .xcworkspace file to open the project in Xcode and update the version and build number there.

Ionic app doesn't hit on server when using capacitor

My Ionic app works fine when running with ionic serve but when i use the command ionic capacitor run android -l it doesn't hit on sever and gives error
Webpage not available: net::ERR_CONNECTION_REFUSED
I am using the latest Ionic version.
capacitor.config.json
{
"appId": "fire.app.flashlight",
"appName": "Flashlight",
"bundledWebRuntime": false,
"windowsAndroidStudioPath": "C:\\Users\\Digisoft\\Downloads\\Compressed\\android-studio-ide-201.6692364-windows\\android-studio\\bin\\studio64.exe",
"npmClient": "npm",
"webDir": "www",
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
}
},
"cordova": {},
"server": {
"url": "http://localhost:8100",
"cleartext": true
}
}
Try to erase the "url" inside the "server"

create react native app expo failed to connect running on emulator in same computer

I'm new to react native, I've used create-react-native-app command to generate a project, executed npm start to start the packager. Until now all is good, the packager is running on address 192.168.232.56:19000, it shows me the QR code and the menu, but when I hit a to start the app in the emulator, the expo app shows:
Something went wrong, could not load exp://192.168.232.56:19000
with the log stating
ConnectException: Failed to connect to /192.168.232.56:19000
usning the browser in the emulator I can freely surf the internet, so there is connection
Any help greatle appreciated!! (just to clarify, the emulator is running in the same computer where I develop and the packager is running)
UPDATE: accessing address 10.0.2.2:19000 from the browser in the emulator throws the following json:
{
"sdkVersion": "27.0.0",
"name": "template",
"slug": "template",
"version": "0.1.0",
"xde": true,
"developer": {
"tool": "crna",
"projectRoot": "/home-root/repo/template"
},
"packagerOpts": {
"hostType": "tunnel",
"lanType": "ip",
"dev": true,
"minify": false,
"urlRandomness": null
},
"env": {},
"bundleUrl": "http://localhost:19001/./node_modules/react-native-scripts/build/bin/crna-entry.bundle?platform=ios&dev=true&minify=false&hot=false&assetPlugin=%2Fhome-root%2Frepo%2Ftemplate%2Fnode_modules%2Fexpo%2Ftools%2FhashAssetFiles",
"debuggerHost": "localhost:19001",
"mainModuleName": "./node_modules/react-native-scripts/build/bin/crna-entry",
"logUrl": "http://localhost:19000/logs",
"id": "#anonymous/template-a79d4723-c675-4546-8d61-74b0a969417f"
}
Try using Expo XDE. If that doesn't work, try changing the host type. Restarting everything might also help you, as well as clearing the packager cache. If nothing works, might be your firewall is blocking ports 19003 to 19000, but I believe that shouldn't be a problem, since you are running a local emulator