You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by GitBox <gi...@apache.org> on 2018/10/03 06:41:46 UTC

[GitHub] cxfeng1 closed pull request #1617: [iOS] Only use __enable_native_promise__ option when explicitly set i…

cxfeng1 closed pull request #1617: [iOS] Only use __enable_native_promise__ option when explicitly set i…
URL: https://github.com/apache/incubator-weex/pull/1617
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.h b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.h
index b58d32731c..aa7e5a754f 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.h
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.h
@@ -116,6 +116,7 @@ namespace WeexCore
         void PostMessage(const char* vm_id, const char* data, int dataLength) override {};
         void DispatchMessage(const char* client_id,
                              const char* data, int dataLength, const char* callback, const char* vm_id) override {};
+        void OnReceivedResult(long callback_id, std::unique_ptr<WeexJSResult>& result) override {};
     };
     
     class WXCoreMeasureFunctionBridge : public MeasureFunctionAdapter
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
index 7927f00f9a..b7b73a58b6 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
@@ -35,7 +35,7 @@
 #import <CommonCrypto/CommonCrypto.h>
 #import <CoreText/CoreText.h>
 #import "WXAppMonitorProtocol.h"
-
+#import "WXConfigCenterProtocol.h"
 #import "WXTextComponent.h"
 
 #define KEY_PASSWORD  @"com.taobao.Weex.123456"
@@ -209,7 +209,7 @@ + (NSDictionary *)getEnvironment
     
     NSMutableDictionary *data = [NSMutableDictionary dictionaryWithDictionary:@{
                                     @"platform":platform,
-                                    @"osName":platform,//osName is eaqual to platorm name in native
+                                    @"osName":platform, //osName is eaqual to platorm name in native
                                     @"osVersion":sysVersion,
                                     @"weexVersion":weexVersion,
                                     @"deviceModel":machine,
@@ -220,6 +220,20 @@ + (NSDictionary *)getEnvironment
                                     @"scale":@(scale),
                                     @"logLevel":[WXLog logLevelString] ?: @"error"
                                 }];
+    
+    if ([[[UIDevice currentDevice] systemVersion] integerValue] >= 11) {
+        id configCenter = [WXSDKEngine handlerForProtocol:@protocol(WXConfigCenterProtocol)];
+        if ([configCenter respondsToSelector:@selector(configForKey:defaultValue:isDefault:)]) {
+            // update
+            BOOL isDefault = YES;
+            BOOL jsfmEnableNativePromiseOnIOS11AndLater = [[configCenter configForKey:@"iOS_weex_ext_config.jsfmEnableNativePromiseOnIOS11AndLater" defaultValue:@(NO) isDefault:&isDefault] boolValue];
+            if (!isDefault) {
+                // has this config explicitly
+                data[@"__enable_native_promise__"] = @(jsfmEnableNativePromiseOnIOS11AndLater);
+            }
+        }
+    }
+    
     if ([WXSDKEngine customEnvironment]) {
         [data addEntriesFromDictionary:[WXSDKEngine customEnvironment]];
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services