title | description | date |
---|---|---|
WhiteBirdUS |
基于友盟的QQ、微信、新浪微博的三方分享、三方登录 |
2016/10/24 |
支持平台:ios
-------------------------------------------------------------------- 插件的集成步骤 -------------------------------------------------------------------- 1.配置插件中的相应参数 1).配置插件中plugin.xml文件中 m24下的 UmengID以及QQ 微信 新浪的appKey与appSercet(统一名称,注意在注册时,不同的平台称呼可能有所出入,有的叫做appId与appKey,请依据示例所填写内容自行对应)。 2).配置插件中plugin.xml文件中 m116下的URLSchemes,规则如下: 微信: 微信appKey QQ : "tencent"+腾讯QQ互联应用appID “QQ”+腾讯QQ互联应用appID转换成十六进制(不足8位前面补0) 新浪: "wb"+新浪appKey 2.将cordova-plugin-WhiteBirdUS文件加添加到工程路径下。 3.执行 ionic plugins add cordova-plugin-WhiteBirdUS安装插件。 4.执行 ionic build ios(你会发现这个会报错,即时报错,也要执行) 5.在生成的Xcode工程中,在xxx-info.plist中加入安全域名白名单(右键xxx-info.plist用source code打开),适配ios10 NSAppTransportSecurity NSAllowsArbitraryLoads NSExceptionDomains log.umsns.com NSIncludesSubdomains NSTemporaryExceptionAllowsInsecureHTTPLoads NSTemporaryExceptionMinimumTLSVersion TLSv1.1 sns.whalecloud.com NSIncludesSubdomains NSTemporaryExceptionAllowsInsecureHTTPLoads NSTemporaryExceptionMinimumTLSVersion TLSv1.1 qq.com NSIncludesSubdomains NSThirdPartyExceptionAllowsInsecureHTTPLoads NSThirdPartyExceptionRequiresForwardSecrecy sina.com.cn NSIncludesSubdomains NSThirdPartyExceptionAllowsInsecureHTTPLoads NSThirdPartyExceptionRequiresForwardSecrecy sinaimg.cn NSIncludesSubdomains NSThirdPartyExceptionAllowsInsecureHTTPLoads NSThirdPartyExceptionRequiresForwardSecrecy sinajs.cn NSIncludesSubdomains NSThirdPartyExceptionAllowsInsecureHTTPLoads NSThirdPartyExceptionRequiresForwardSecrecy sina.cn NSExceptionMinimumTLSVersion TLSv1.0 NSIncludesSubdomains NSThirdPartyExceptionRequiresForwardSecrecy weibo.cn NSExceptionMinimumTLSVersion TLSv1.0 NSIncludesSubdomains NSThirdPartyExceptionRequiresForwardSecrecy weibo.com NSExceptionMinimumTLSVersion TLSv1.0 NSIncludesSubdomains NSThirdPartyExceptionAllowsInsecureHTTPLoads NSThirdPartyExceptionRequiresForwardSecrecy
<!-- 集成人人授权对应的HTTP白名单-->
<key>renren.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<!-- 人人授权-->
<!-- 集成Facebook授权对应的HTTP白名单-->
<key>facebook.com</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>fbcdn.net</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>akamaihd.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<!-- Facebook授权-->
<!-- 集成Twitter授权对应的HTTP白名单-->
<key>twitter.com</key>
<dict>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<!-- Twitter授权-->
<!-- 集成Llinkedin授权对应的HTTP白名单-->
<key>linkedin.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<!-- Llinkedin授权-->
</dict>
添加或是用以上代码替换如下代码 NSAppTransportSecurity NSAllowsArbitraryLoads 注:白名单已经通过plugin.xml内部代码配置,不需要在单独配置。 白名单与以上加入代码,可依据即时的友盟官网中社会化分享集成文档进行相应替换。
6.设置Xcode Build Settings->C Language Dialect->GNU99 友盟文件编译需求,如果不设置,文件编译不通过
-------------------------------------------------------------------- 特殊集成事项 --------------------------------------------------------------------
在集成执行 ionic build ios 的时候,会报出如下错误为正常。 The following build commands failed: Ld build/emulator/APP.app/APP normal i386 (1 failure) Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/white-bird/Desktop/dhcApp/AppIonic/platforms/ios/cordova/build-debug.xcconfig,-project,APP.xcodeproj,-target,APP,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,build,CONFIGURATION_BUILD_DIR=/Users/white-bird/Desktop/dhcApp/AppIonic/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/white-bird/Desktop/dhcApp/AppIonic/platforms/ios/build/sharedpch 因为最新的QQ官方库文件,废弃了i386处理器的相应内容,在ionic执行build的过程中i368的相应内容,仍会被处理,故此报错,但对于手机App应用不会有任何影响。
当插件内部内容有所修改的时候,需要重新安装插件(ionic plugins rm cordova-plugin-WhiteBirdUS),或者移除ios platform(ionic platform rm ios) 重新添加ios platform(ionic platform add ios)
如果你的项目里面应用了微信支付插件 com.comall.wechat.pay 建议将其plugin.xml中的m64下的如下代码, 注释,以免造成重复引用,因为本插件的此三个文件,并不明确其出生日期,而本插件内容的为2016/10/24日的最新的三方内容(不注释也并无什么问题)
-------------------------------------------------------------------- 插件方法 --------------------------------------------------------------------
/*
.share = function (title, desc, imageUrl, url, callbackSuccess, callbackError) { exec(callbackSuccess, callbackError, "WhiteBirdUSPlugin", "share", [title, desc, imageUrl, url]); };
/*
/*
/*
/*
/*
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型