Commit 2bcacf87091bf8a83054ec6997dc196aa2ddf49b
1 parent
ed253529
添加微信sdk需要的一些回调和工程配置
Showing
4 changed files
with
50 additions
and
6 deletions
ios/Runner.xcodeproj/project.pbxproj
| @@ -2310,7 +2310,6 @@ | @@ -2310,7 +2310,6 @@ | ||
| 2310 | CLANG_ENABLE_MODULES = YES; | 2310 | CLANG_ENABLE_MODULES = YES; |
| 2311 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 2311 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 2312 | CODE_SIGN_STYLE = Manual; | 2312 | CODE_SIGN_STYLE = Manual; |
| 2313 | - CURRENT_PROJECT_VERSION = 4; | ||
| 2314 | DEVELOPMENT_TEAM = ""; | 2313 | DEVELOPMENT_TEAM = ""; |
| 2315 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = T8P9KW8GWH; | 2314 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = T8P9KW8GWH; |
| 2316 | ENABLE_BITCODE = NO; | 2315 | ENABLE_BITCODE = NO; |
| @@ -2319,7 +2318,6 @@ | @@ -2319,7 +2318,6 @@ | ||
| 2319 | "$(inherited)", | 2318 | "$(inherited)", |
| 2320 | "@executable_path/Frameworks", | 2319 | "@executable_path/Frameworks", |
| 2321 | ); | 2320 | ); |
| 2322 | - MARKETING_VERSION = 1.0.3; | ||
| 2323 | OTHER_CFLAGS = ( | 2321 | OTHER_CFLAGS = ( |
| 2324 | "-DNDEBUG", | 2322 | "-DNDEBUG", |
| 2325 | "'-std=gnu99'", | 2323 | "'-std=gnu99'", |
| @@ -2657,7 +2655,6 @@ | @@ -2657,7 +2655,6 @@ | ||
| 2657 | CLANG_ENABLE_MODULES = YES; | 2655 | CLANG_ENABLE_MODULES = YES; |
| 2658 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 2656 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 2659 | CODE_SIGN_STYLE = Manual; | 2657 | CODE_SIGN_STYLE = Manual; |
| 2660 | - CURRENT_PROJECT_VERSION = 4; | ||
| 2661 | DEVELOPMENT_TEAM = ""; | 2658 | DEVELOPMENT_TEAM = ""; |
| 2662 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = T8P9KW8GWH; | 2659 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = T8P9KW8GWH; |
| 2663 | ENABLE_BITCODE = NO; | 2660 | ENABLE_BITCODE = NO; |
| @@ -2688,7 +2685,6 @@ | @@ -2688,7 +2685,6 @@ | ||
| 2688 | "$(inherited)", | 2685 | "$(inherited)", |
| 2689 | "@executable_path/Frameworks", | 2686 | "@executable_path/Frameworks", |
| 2690 | ); | 2687 | ); |
| 2691 | - MARKETING_VERSION = 1.0.3; | ||
| 2692 | ONLY_ACTIVE_ARCH = NO; | 2688 | ONLY_ACTIVE_ARCH = NO; |
| 2693 | OTHER_CFLAGS = "'-std=gnu99'"; | 2689 | OTHER_CFLAGS = "'-std=gnu99'"; |
| 2694 | OTHER_CPLUSPLUSFLAGS = "'-std=c++11'"; | 2690 | OTHER_CPLUSPLUSFLAGS = "'-std=c++11'"; |
| @@ -2865,7 +2861,6 @@ | @@ -2865,7 +2861,6 @@ | ||
| 2865 | CLANG_ENABLE_MODULES = YES; | 2861 | CLANG_ENABLE_MODULES = YES; |
| 2866 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 2862 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 2867 | CODE_SIGN_STYLE = Manual; | 2863 | CODE_SIGN_STYLE = Manual; |
| 2868 | - CURRENT_PROJECT_VERSION = 4; | ||
| 2869 | DEVELOPMENT_TEAM = ""; | 2864 | DEVELOPMENT_TEAM = ""; |
| 2870 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = T8P9KW8GWH; | 2865 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = T8P9KW8GWH; |
| 2871 | ENABLE_BITCODE = NO; | 2866 | ENABLE_BITCODE = NO; |
| @@ -2874,7 +2869,6 @@ | @@ -2874,7 +2869,6 @@ | ||
| 2874 | "$(inherited)", | 2869 | "$(inherited)", |
| 2875 | "@executable_path/Frameworks", | 2870 | "@executable_path/Frameworks", |
| 2876 | ); | 2871 | ); |
| 2877 | - MARKETING_VERSION = 1.0.3; | ||
| 2878 | OTHER_CFLAGS = ( | 2872 | OTHER_CFLAGS = ( |
| 2879 | "-DNDEBUG", | 2873 | "-DNDEBUG", |
| 2880 | "'-std=gnu99'", | 2874 | "'-std=gnu99'", |
ios/Runner/AppDelegate.swift
| @@ -13,6 +13,35 @@ import Flutter | @@ -13,6 +13,35 @@ import Flutter | ||
| 13 | _ = XSMessageMehtodChannel(message: controller.binaryMessenger); | 13 | _ = XSMessageMehtodChannel(message: controller.binaryMessenger); |
| 14 | _ = GameMessageChannel(message: controller.binaryMessenger); | 14 | _ = GameMessageChannel(message: controller.binaryMessenger); |
| 15 | 15 | ||
| 16 | + let registerWX = WXApi.registerApp("wx365e5a79956a450a", universalLink: "https://app-api.wowenglish.com.cn/app/"); | ||
| 17 | + if registerWX == true { | ||
| 18 | + print("WXApi register 成功"); | ||
| 19 | + } else { | ||
| 20 | + print("WXApi register 失败"); | ||
| 21 | + } | ||
| 22 | + | ||
| 16 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) | 23 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) |
| 17 | } | 24 | } |
| 25 | + | ||
| 26 | + override func application(_ application: UIApplication, handleOpen url: URL) -> Bool { | ||
| 27 | + return WXApi.handleOpen(url, delegate: self); | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + override func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { | ||
| 31 | + return WXApi.handleOpen(url, delegate: self); | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + override func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void) -> Bool { | ||
| 35 | + return WXApi.handleOpenUniversalLink(userActivity, delegate: self); | ||
| 36 | + } | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +extension AppDelegate: WXApiDelegate { | ||
| 40 | + func onReq(_ req: BaseReq) { | ||
| 41 | + print("WXApiDelegate onReq"); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + func onResp(_ resp: BaseResp) { | ||
| 45 | + print("WXApiDelegate onResp "); | ||
| 46 | + } | ||
| 18 | } | 47 | } |
ios/Runner/Info.plist
| @@ -2,6 +2,15 @@ | @@ -2,6 +2,15 @@ | ||
| 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 3 | <plist version="1.0"> | 3 | <plist version="1.0"> |
| 4 | <dict> | 4 | <dict> |
| 5 | + <key>LSApplicationQueriesSchemes</key> | ||
| 6 | + <array> | ||
| 7 | + <string>wechat</string> | ||
| 8 | + <string>weixin</string> | ||
| 9 | + <string>weixinULAPI</string> | ||
| 10 | + <string>weixinURLParamsAPI</string> | ||
| 11 | + <string>alipay</string> | ||
| 12 | + <string>alipayshare</string> | ||
| 13 | + </array> | ||
| 5 | <key>CADisableMinimumFrameDurationOnPhone</key> | 14 | <key>CADisableMinimumFrameDurationOnPhone</key> |
| 6 | <true/> | 15 | <true/> |
| 7 | <key>CFBundleDevelopmentRegion</key> | 16 | <key>CFBundleDevelopmentRegion</key> |
| @@ -44,6 +53,16 @@ | @@ -44,6 +53,16 @@ | ||
| 44 | <string>alipayishowwoweng</string> | 53 | <string>alipayishowwoweng</string> |
| 45 | </array> | 54 | </array> |
| 46 | </dict> | 55 | </dict> |
| 56 | + <dict> | ||
| 57 | + <key>CFBundleTypeRole</key> | ||
| 58 | + <string>Editor</string> | ||
| 59 | + <key>CFBundleURLName</key> | ||
| 60 | + <string>weixin</string> | ||
| 61 | + <key>CFBundleURLSchemes</key> | ||
| 62 | + <array> | ||
| 63 | + <string>wx365e5a79956a450a</string> | ||
| 64 | + </array> | ||
| 65 | + </dict> | ||
| 47 | </array> | 66 | </array> |
| 48 | <key>CFBundleVersion</key> | 67 | <key>CFBundleVersion</key> |
| 49 | <string>5</string> | 68 | <string>5</string> |