私は React Native を初めて使用し、PushNotificationIOS をテストしています。しかし、checkpermission 呼び出しで Android でエラーが発生します。
ExceptionsManager.js:61 Cannot read property 'checkPermissions' of undefined
これは、iOS でのみコンポーネントを使用する必要があるためだと思います。OS のチェックを追加して、iOS でのみ呼び出しを行うにはどうすればよいですか?
これが私のコードです:
componentWillMount: function() {
//-- need an OS check here??
PushNotificationIOS.checkPermissions((data)=> {
console.log("in comp will mount: checking for permission")
console.log(data.alert)
console.log(data.badge)