Monacaを利用してiOSアプリを作成しております。
InAppBrowserを利用してシステム標準のWebブラウザー(_system)を利用してGoogleのOAuth2.0を実装しているのですがAppStore申請で却下となりました。却下理由はSafari View Controllerを利用してくださいとのことです。
ちなみにInAppBrowserで開くとGoogleでエラーになってしまいます。
Guideline 4.0 - Design
We noticed that the user is taken to Safari to sign in or register for an account, which provides a poor user experience.
Next Steps
To resolve this issue, please revise your app to enable users to sign in or register for an account in the app.
We recommend implementing the Safari View Controller API to display web content within your app. The Safari View Controller allows the display of a URL and inspection of the certificate from an embedded browser in an app so that customers can verify the webpage URL and SSL certificate to confirm they are entering their sign in credentials into a legitimate page.
という経緯で「cordova-plugin-safariviewcontroller」というプラグインがありましたので
MonacaのCordovaプラグインの管理からインストールしてサンプルソースを
そのままテストしてみましたが動く気配もありません。
cordova-plugin-safariviewcontroller
https://github.com/EddyVerbruggen/cordova-plugin-safariviewcontroller
function openUrl(url, readerMode) { SafariViewController.isAvailable(function (available) { if (available) { SafariViewController.show({ url: url, hidden: false, // default false. You can use this to load cookies etc in the background (see issue #1 for details). animated: false, // default true, note that 'hide' will reuse this preference (the 'Done' button will always animate though) transition: 'curl', // (this only works in iOS 9.1/9.2 and lower) unless animated is false you can choose from: curl, flip, fade, slide (default) enterReaderModeIfAvailable: readerMode, // default false tintColor: "#00ffff", // default is ios blue barColor: "#0000ff", // on iOS 10+ you can change the background color as well controlTintColor: "#ffffff" // on iOS 10+ you can override the default tintColor }, // this success handler will be invoked for the lifecycle events 'opened', 'loaded' and 'closed' function(result) { if (result.event === 'opened') { console.log('opened'); } else if (result.event === 'loaded') { console.log('loaded'); } else if (result.event === 'closed') { console.log('closed'); } }, function(msg) { console.log("KO: " + msg); }) } else { // potentially powered by InAppBrowser because that (currently) clobbers window.open window.open(url, '_blank', 'location=yes'); } }) } function dismissSafari() { SafariViewController.hide() }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/10/18 02:45