I'm new to react native. I'm familiar with react.
I'm using Expo. Running npm start and then running iOS simulator from the menu has been working just fine until recently. When running npm start, console prints something like:
Metro waiting on exp+jorato://expo-development-client/url=http%3A%2F%2F192.168.1.129%3A8081
Previously this was a different url like:
Metro waiting on exp://192.168.1.129:8081
After it has changed to this long url, when trying open the iOS simulator, i get this error:
› Opening on iOS...
› Opening exp+jorato://expo-development-client/?url=http%3A%2F%2F192.168.1.129%3A8081 on iPhone 13
Device iPhone 13 (B7D52679-208F-49F2-8FF6-9E2CC4A47073) has no app to handle the URI: exp+jorato://expo-development-client/?url=http%3A%2F%2F192.168.1.129%3A8081
"jorato" comes from my app.json setting frome "scheme" under "expo":
"expo": {
"name": "Jorato",
"slug": "jorato",
"version": "1.0.0",
"scheme": "jorato",
...
I've been searching for documentation of where this url comes from with no luck. Anyone who could point me in right direction would be much appreciated.
Update: Found https://docs.expo.dev/development/development-workflows/, which defines that deep links use:
{scheme}://expo-development-client/?url={manifestUrl}
URL scheme of your client (defaults to exp+{slug} where slug is the value set in your app.json)
This seems consistent with what i'm getting. So must be something else that's the problem.
It seems that combined with the knowledge gained here https://docs.expo.dev/development/development-workflows/ that the problem is related to having a prior ios build and then that being deleted but not being done correctly. I've made a new build and am no longer getting this issue. Not completely sure what the reason was.
Related
I'm building a React Native app with Expo (SDK v35) and upon delivering the binaries to App Store Connect, I get a warning that many have gotten:
ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs.
I realize the warning is related to react-native-webview prior to v7.0.1 and that it will come up if UIWebView is used anywhere, including the dependencies.
However, I have cleaned up the code in its entirety, to the point that grep -r UIWebView ./* turns up empty (I even removed comments). I also ensured that all dependencies use a version of react-native-webview that is greater than the patched 7.0.1 version. Here's the log from grep -r webview ./node_modules/*/package.json:
./node_modules/react-native-signature-canvas/package.json: "react-native-webview": "^7.5.2"
./node_modules/react-native-webview/package.json: "_from": "react-native-webview#^7.5.2",
./node_modules/react-native-webview/package.json: "_id": "react-native-webview#7.6.0",
./node_modules/react-native-webview/package.json: "_location": "/react-native-webview",
./node_modules/react-native-webview/package.json: "raw": "react-native-webview#^7.5.2",
./node_modules/react-native-webview/package.json: "name": "react-native-webview",
./node_modules/react-native-webview/package.json: "escapedName": "react-native-webview",
./node_modules/react-native-webview/package.json: "_resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-7.6.0.tgz",
./node_modules/react-native-webview/package.json: "_spec": "react-native-webview#^7.5.2"
The only part of the app where WebView is actually used is through the module react-native-signature-canvas, which not only uses webview versions >= 7.5.2 but also passes useWebKit={true} as props, ensuring the use of WKWebView, not UIWebView.
Any suggestions on how to get rid of the warning? Also, if I submit the app for review anyway, will it be rejected? Is the warning taken into consideration for review or will they simply test the app on an iOS version that does not support UIWebView and see if it runs normally?
It looks like the Expo team has addressed this and a fix will be released in Expo SDK 37. More details found on this Github issue: https://github.com/expo/expo/issues/5497
The warning is given because the compiled app still has the UIWebView API inside it, even if the useWebKit={true} prop is set. Unfortunately Apple has just informed developers that they will no longer be accepting app submissions from April 2020 that use or have the UIWebView inside the application. In the meantime you can submit new and updated applications to the App Store until this hard deadline.
If you are using useWebKit={true}, that is to say, you are using WKWebView not UIWebView at all. Then you can do the following to solve the problem -- Deprecated API Usage.
Remove Libraries/RNCWebView.xcodeproj/RNCUIWebView.h、RNCUIWebView.m、RNCUIWebViewManager.h、RNCUIWebViewManager.m
Remove Libraries/React.xcodeproj/React/Views/RCTWebView.h、RCTWebView.m、RCTWebViewManager.h、RCTWebViewManager.m
Now I have already uploaded app.ipa to AppStore successfully without any permission warnings.
That's all. I work for me. I hope it helps.
could somebody explain how the Expo client decides whether to refresh my app or use the current version cached (~already downloaded) in the client?
When I'm pushing out a new version with exp push, the Expo app (on Android) doesn't seem to pick it up, unless I clear all data of the app.
I thought that bumping the expo.version in the app.json would solve this but this doesn't seem to be the case.
Thanks!
UPDATE
Ok, I understand it is supposed to happen automatically, but this doesn't seem so - I tried multiple devices which were not offline - I suppose there must be something obvious I'm missing...
https://docs.expo.io/versions/latest/guides/offline-support.html#load-js-updates-in-the-background
Check that you don't have this option on the app.json file:
"updates": {
"fallbackToCacheTimeout": 0
},
I had this option in there and it prevented the app from waiting for a new version to be downloaded.
(on Android) I succeeded by opening the app in Expo, I would see the cached version, then I force stopped the app intentionally, both the app and the expo client. This removes it from the list of open apps on the phone.
Relaunched the expo client, then tapped my demo app again, and it loaded the new version. Tested a few seconds after publishing.
I have a react native application(using react-native 0.43.3) that uses webview to show a web page used for online banking. That site loads a popup window with the login page.
With the ReactNative WebView this popup window in not shown. In native android to enable popup window showing I found out that I need to make webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true), but couldn't found a way to set this parameter when using ReactNative WebView.
Is there a way which I can achieve this with the WebView provided with ReactNative?
A while back I needed to fork the react-native framework because there is a bug in the iOS WebView when using javaScript bridge between react-native and native (iOS and Android), after some research I came to the conclusion that I must fork the repo in order to fix it so I did.
A week ago I needed the webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(boolean) method as well, so I went ahead and added it in my fork along with view.getSettings().setSupportZoom(boolean) and view.getSettings().setSupportMultipleWindows(supports).
If you want, here is my fork.
Please keep in mind that it means that you need to build react-native for android from source, more info on the matter can be found here, it's a bit of a hustle to be honest, but in some cases it's worth it.
the fork is from react-native 0.44.0, you should also keep in mind that if you use my fork, in means you probably wont be able to update version when they do come out, so it all depends on your needs in the end, worst case scenario you could always fork my fork and merge it with the newest version.
you can fetch my fork with npm by modifying you package.json file and then running npm update react-native
"dependencies": {
//...
"react-native": "samermurad/react-native#rctWebView-legacy-fix",
//...
}
I am planning to extract the fixes and build a separate WebView component, but I am currently too busy for that :/
I hope that helps:)
I have developed an app using React-native, now i converted to expo using exp convert. I did all the changes to folder which is need (by following steps in expo-next-steps.txt) but when i run project on expo XDE, i am getting error like
Error: Missing app.json. How to solve this problem? and i used local push notification in react-native app. But in project structure there is file called app.json, still getting this error. i am new to expo, anyone please help me out.
The expo XDK looks for the expo SDK version in the app.json file. Thus, your app.json should look something like :
{
"name": "MyAPP",
"displayName": "MyAPP",
"expo": {
"sdkVersion": "18.0.0"
}
}
Replace the "18.0.0" with your SDK version.
Such error emerges when you create the app using
react-native init
instead of
create-react-native-app
I perceive this as one of the reasons. There may be more such explanations to such occurrences.Happy coding!
I deleted the app.json, restarted and it works in my setup.
You might rename it simply to app.json.orig
I built an application using Sencha Touch 2 "Building Sencha native application." The application is built and the IOS simulator is a success. However, the application remains on the page with a load indicator (three blinking dots). No error or warning. The application loads and works fine in Chrome browser.
Any suggestions please?
I hope you found the solution. If not, following is my suggestion.
I was stuck in same issue.
It killed my excitement to run the app in simulator[Because there were no errors to deal with, clueless what was wrong]. Searched sencha's ambiguous documentation and forums and found the following fix:
Step 1: Open app.json file.
Step 2: Search for:
/**
* Build options
*/
"buildOptions": {
"product": "touch",
"minVersion": 3,
"debug": false,
"logger": "no"
},
Step 3: Change the last line "logger":"no" to "logger":false
I have not found an answer why this needs to be changed. Might be they have changed the value for the configuration keyword in the SDK but not updated here in app.json [ If somebody can help to understand why, it would be great]. I am not sure. But that worked for me. I was able to test the app in iOS simulator.
I have not tested on Android simulator and actual devices yet.
Hope this helps!.
Thanks.
I'm fighting with what could be the same problem and it seems to be due to it trying to load various files, even though the contents of them have been bundled into app.js. You can see if this is your problem by looking for red files in the Resource tab of the web inspector.
You can also check iOS Simulator logs:
iOS Simulator -> Debug -> Open System Log ...
Might tell you that some entries in comfig.xml are missing