提交 583d58bd authored 作者: JarvanMo's avatar JarvanMo

make app_id is not required on iOS #536

上级 d2348fbc
...@@ -29,7 +29,7 @@ EXTERNAL SOURCES: ...@@ -29,7 +29,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
fluwx: 1cbf0e7cba1a5805ac928cbc3165c88580a7c53f fluwx: d725e175af372180498ce6daad7be464f48c78b5
integration_test: 13825b8a9334a850581300559b8839134b124670 integration_test: 13825b8a9334a850581300559b8839134b124670
WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69 WechatOpenSDK-XCFramework: acdeeda129efbef9532bca8a10c24e1b4b8c7d69
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string/> <string></string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
...@@ -25,23 +25,11 @@ ...@@ -25,23 +25,11 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <array/>
<dict/>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>123456</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
<string/> <string></string>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>weixin</string> <string>weixin</string>
......
...@@ -84,7 +84,7 @@ flutter: ...@@ -84,7 +84,7 @@ flutter:
# see https://flutter.dev/custom-fonts/#from-packages # see https://flutter.dev/custom-fonts/#from-packages
fluwx: fluwx:
app_id: 123456 # app_id: 123456
# only debug in debug mode # only debug in debug mode
debug_logging: true debug_logging: true
android: android:
......
...@@ -27,12 +27,22 @@ else ...@@ -27,12 +27,22 @@ else
fluwx_subspec = 'pay' fluwx_subspec = 'pay'
end end
Pod::UI.puts "using sdk with #{fluwx_subspec}" Pod::UI.puts "using sdk with #{fluwx_subspec}"
if cfg['fluwx'] && (cfg['fluwx']['app_id'] && cfg['fluwx']['ios'] && cfg['fluwx']['ios']['universal_link'])
app_id = nil
if cfg['fluwx'] && cfg['fluwx']['app_id']
app_id = cfg['fluwx']['app_id'] app_id = cfg['fluwx']['app_id']
end
if cfg['fluwx'] && (cfg['fluwx']['ios'] && cfg['fluwx']['ios']['universal_link'])
universal_link = cfg['fluwx']['ios']['universal_link'] universal_link = cfg['fluwx']['ios']['universal_link']
system("ruby #{current_dir}/wechat_setup.rb -a #{app_id} -u #{universal_link} -p #{project_dir} -n Runner.xcodeproj") if app_id.nil?
system("ruby #{current_dir}/wechat_setup.rb -u #{universal_link} -p #{project_dir} -n Runner.xcodeproj")
else
system("ruby #{current_dir}/wechat_setup.rb -a #{app_id} -u #{universal_link} -p #{project_dir} -n Runner.xcodeproj")
end
else else
abort("required values:[app_id, universal_link] are missing. Please add them in pubspec.yaml:\nfluwx:\n app_id: ${app id}\n \nios:\nuniversal_link: https://${applinks domain}/universal_link/${example_app}/wechat/\n") abort("required values:[auniversal_link] are missing. Please add them in pubspec.yaml:\nfluwx:\n \nios:\nuniversal_link: https://${applinks domain}/universal_link/${example_app}/wechat/\n")
end end
Pod::Spec.new do |s| Pod::Spec.new do |s|
......
...@@ -79,14 +79,16 @@ project.targets.each do |target| ...@@ -79,14 +79,16 @@ project.targets.each do |target|
result["CFBundleURLTypes"] = urlTypes result["CFBundleURLTypes"] = urlTypes
end end
isUrlTypeExist = urlTypes.any? { |urlType| urlType["CFBundleURLSchemes"] && (urlType["CFBundleURLSchemes"].include? app_id) } isUrlTypeExist = urlTypes.any? { |urlType| urlType["CFBundleURLSchemes"] && (urlType["CFBundleURLSchemes"].include? app_id) }
if !isUrlTypeExist if !app_id.nil? && !app_id.empty? && !isUrlTypeExist
urlTypes << { print("writing app id\n ")
urlTypes << {
"CFBundleTypeRole": "Editor", "CFBundleTypeRole": "Editor",
"CFBundleURLName": "weixin", "CFBundleURLName": "weixin",
"CFBundleURLSchemes": [ app_id ] "CFBundleURLSchemes": [ app_id ]
} }
File.write(infoplistFile, Plist::Emit.dump(result)) File.write(infoplistFile, Plist::Emit.dump(result))
end end
queriesSchemes = result["LSApplicationQueriesSchemes"] queriesSchemes = result["LSApplicationQueriesSchemes"]
if !queriesSchemes if !queriesSchemes
queriesSchemes = [] queriesSchemes = []
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论