Commit 2332162ce292d9555a413ccc2301f042754070f8

Authored by kingzh
1 parent c80ffd587b
Exists in master

修改UIWebView为WKWebview

Showing 11 changed files with 74 additions and 15 deletions Side-by-side Diff

1 1 Pods/
2 2 Podfile.lock
  3 +.DS_Store
GameLoginSDK.framework/GameLoginSDK
No preview for this file type
GameLoginSDK.framework/Info.plist
No preview for this file type
GameSDK.framework/Versions/A/GameSDK
No preview for this file type
GameSDK.framework/Versions/A/Headers/LetsGameAPI.h
... ... @@ -4,7 +4,7 @@
4 4 //默认横屏
5 5 static BOOL DeviceOrientationIsHorizontal = YES;
6 6  
7   -static NSString *pVersion = @"4.0.6";
  7 +static NSString *pVersion = @"4.0.8";
8 8  
9 9 @interface LetsGameAPI : NSObject<UIApplicationDelegate>
10 10  
GameSDKResources.bundle/PayJs2.txt
... ... @@ -0,0 +1,44 @@
  1 +;(function() {
  2 +
  3 +var bridge = 'sdk';
  4 +
  5 +if (window[bridge]) { return }
  6 +
  7 +
  8 +window[bridge] = {};
  9 +
  10 +window[bridge]['webVer'] = function webVer(webVer){
  11 +
  12 +window.webkit.messageHandlers.sdk.postMessage({'m':'webVer','p':JSON.stringify(arguments)});
  13 +};
  14 +
  15 +
  16 +
  17 +window[bridge]['payWithBlue'] = function payWithBlue(payGateId,price,cardNO,roleId){
  18 +window.webkit.messageHandlers.sdk.postMessage({'m':'payWithBlue','p':JSON.stringify(arguments)});
  19 +};
  20 +
  21 +
  22 +window[bridge]['closeWin'] = function closeWin(oid,status,extraInfo){
  23 +window.webkit.messageHandlers.sdk.postMessage({'m':'closeWin','p':JSON.stringify(arguments)});
  24 +};
  25 +
  26 +window[bridge]['newWindow'] = function newWindow(url){
  27 +window.webkit.messageHandlers.sdk.postMessage({'m':'newWindow','p':JSON.stringify(arguments)});
  28 +}
  29 +
  30 +//var methods = ["closeWin(uid,nick,sessionKey)"];
  31 +//var methodsWithoutParam =["closeWin"];
  32 +//for (var i=0;i<methods.length;i++){
  33 +// var method = methods[i];
  34 +// var methodWithoutParam = methodsWithoutParam[i];
  35 +// var code = "(window[bridge])[methodWithoutParam] = function " + method + " {var fs =CUSTOM_PROTOCOL_SCHEME + ':' + arguments.callee.name + ':' + encodeURIComponent(JSON.stringify(arguments)); messagingIframe.src = fs;alert('closeWin src:'+messagingIframe.src);}";
  36 +// eval(code);
  37 +//}
  38 +
  39 +
  40 +//通知js开始初始化
  41 +if(typeof(onInjectJsOver)=='function')
  42 + onInjectJsOver();
  43 +
  44 +})();
GameSDKResources.bundle/loginJs.txt
1 1 ;(function() {
2   -var messagingIframe,
3   -bridge = 'sdk',
4   -CUSTOM_PROTOCOL_SCHEME = 'jscall';
  2 +
  3 +var bridge = 'sdk';
  4 +
5 5  
6 6 if (window[bridge]) { return }
7 7  
8   -// 创建隐藏的iframe
9   -function _createQueueReadyIframe(doc) {
10   -messagingIframe = doc.createElement('iframe');
11   -messagingIframe.style.display = 'none';
12   -doc.documentElement.appendChild(messagingIframe);
13   -}
  8 +
14 9  
15 10 window[bridge] = {};
16 11  
17 12 window[bridge]['onResult'] = function onResult(result){
18   -document.location=CUSTOM_PROTOCOL_SCHEME + ':' + arguments.callee.name + ':' + encodeURIComponent(JSON.stringify(arguments));
19   -}
  13 +window.webkit.messageHandlers.sdk.postMessage({'m':'onResult','p':JSON.stringify(arguments)});
  14 +
  15 +};
  16 +
  17 +window[bridge]['closeWin'] = function closeWin(oid,status,extraInfo){
  18 +window.webkit.messageHandlers.sdk.postMessage({'m':'closeWin','p':JSON.stringify(arguments)});
  19 +};
  20 +
20 21  
21   -//创建iframe,必须在创建app之后,否则会出现死循环
22   -_createQueueReadyIframe(document);
23 22 //通知js开始初始化
24   -//alert('onInjectJsOver='+typeof(onInjectJsOver));
  23 +
25 24 if(typeof(onInjectJsOver)=='function')
26 25 onInjectJsOver();
27 26  
NNewGumpSDKDemo.xcodeproj/project.xcworkspace/xcuserdata/kingzh.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
NNewGumpSDKDemo.xcodeproj/xcuserdata/kingzh.xcuserdatad/xcschemes/xcschememanagement.plist
... ... @@ -0,0 +1,14 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>SchemeUserState</key>
  6 + <dict>
  7 + <key>NNewGumpSDKDemo.xcscheme_^#shared#^_</key>
  8 + <dict>
  9 + <key>orderHint</key>
  10 + <integer>2</integer>
  11 + </dict>
  12 + </dict>
  13 +</dict>
  14 +</plist>
NNewGumpSDKDemo.xcworkspace/xcuserdata/kingzh.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
  1 +source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
1 2 # Uncomment the next line to define a global platform for your project
2 3 platform :ios, '9.0'
3 4