Bläddra i källkod

Allow link previews, don't show keyboard accessory view, allow to open extenal apps URL, such as WhatsApp

Alex Trofimov 7 år sedan
förälder
incheckning
eef4996344
2 ändrade filer med 5 tillägg och 3 borttagningar
  1. 3 1
      App.js
  2. 2 2
      ios/una.xcodeproj/project.pbxproj

+ 3 - 1
App.js

@@ -201,7 +201,7 @@ export default class App extends Component<Props> {
 
     onWebViewShouldStartLoadWithRequest (event) {
 
-        if (-1 == event.url.indexOf(`${BASE_URL}`) && ('android' === Platform.OS || ('click' == event.navigationType && 'ios' === Platform.OS))) {
+        if (0 != event.url.indexOf('http') || (-1 == event.url.indexOf(`${BASE_URL}`) && ('android' === Platform.OS || ('click' == event.navigationType && 'ios' === Platform.OS)))) {
             Linking.canOpenURL(event.url).then(supported => {
                 if (supported) {
                     Linking.openURL(event.url);
@@ -314,6 +314,8 @@ export default class App extends Component<Props> {
                     builtInZoomControls={false}
                     decelerationRate="normal"
                     cacheEnabled={true}
+                    allowsLinkPreview={true}
+                    hideKeyboardAccessoryView={true}
                     injectedJavaScript={this.javascriptToInject()}
                     onShouldStartLoadWithRequest={this.onWebViewShouldStartLoadWithRequest.bind(this)}
 

+ 2 - 2
ios/una.xcodeproj/project.pbxproj

@@ -717,7 +717,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
 				CODE_SIGN_ENTITLEMENTS = una/una.entitlements;
-				CURRENT_PROJECT_VERSION = 1303;
+				CURRENT_PROJECT_VERSION = 1304;
 				DEAD_CODE_STRIPPING = NO;
 				DEVELOPMENT_TEAM = 235MTP3MJ2;
 				INFOPLIST_FILE = una/Info.plist;
@@ -742,7 +742,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
 				CODE_SIGN_ENTITLEMENTS = una/una.entitlements;
-				CURRENT_PROJECT_VERSION = 1303;
+				CURRENT_PROJECT_VERSION = 1304;
 				DEVELOPMENT_TEAM = 235MTP3MJ2;
 				INFOPLIST_FILE = una/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";