Zah*_*man 8 facebook angularjs cordova ionic-framework
我尝试在Ionic/cordova应用程序中连接Facbook帐户工具包,我面临的主要问题是在facebook帐户工具包中设置客户端/服务器端域名,但在ionic/cordova app中,webview服务来自文件系统("file:/// android_asset/WWW/index.html的#/应用/请求").那么如何在Ionic应用程序中执行此操作.
您可以使用插件代替 webview https://github.com/gurisko/cordova-plugin-accountkit
脚步:
cordova plugin add cordova-plugin-accountkit --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" --variable CLIENT_TOKEN="abcdefghijklmnopqrstuvwxyz"
AccountKitPlugin.loginWithPhoneNumber({
useAccessToken: true,
defaultCountryCode: "US",
},function(res){
console.log(res)
},function(err){
console.log(err)
})Run Code Online (Sandbox Code Playgroud)
如果 Ionic 带有打字稿,只需在函数之前添加(窗口)
(<any>window).AccountKitPlugin.loginWithPhoneNumber({
useAccessToken: true,
defaultCountryCode: "US",
},function(res){
console.log(res)
},function(err){
console.log(err)
})Run Code Online (Sandbox Code Playgroud)
参考: https: //codesundar.com/ionic-accountkit-integration/
| 归档时间: |
|
| 查看次数: |
2914 次 |
| 最近记录: |