Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'cordova-ios-voip-push' #17

Open
Haroon6138 opened this issue Mar 5, 2020 · 7 comments
Open

Cannot find module 'cordova-ios-voip-push' #17

Haroon6138 opened this issue Mar 5, 2020 · 7 comments

Comments

@Haroon6138
Copy link

Hi! First of all thanks for the great plugin

I am trying to use this plugin in Ionic 4, Installation went great, i have also followed all the outlined steps as well. But i am unable to use this plugin in my code as it always says that :

Cannot find name 'VoIPPushNotification'

i have tried importing the plugin in my ts file & in my module as well but i keep getting the error:

Cannot find module 'cordova-ios-voip-push'.

I have imported the plugin with both ways:

  1. cordova.plugins.VoIPPushNotification.init();

  2. import { VoIPPushNotification } from "cordova-ios-voip-push";

But none of them seems to work.

Please point me to the correct way ASAP as i need it urgently & any help would be greatly appreciated.

@mattkhaw
Copy link

I think this link will address your issue -> How to use cordova custom plugin in ionic

@Haroon6138
Copy link
Author

@mattkhaw this is what i did, i declared the cordova variable, that's how i am using some other cordova plugins in my Ionic app, like cordova-call etc., but still wasn't working

@mattkhaw
Copy link

I think you should plug your app into the console and check where VoIPPushNotification is. It shouldn't be using import directive. I think import directive requires a wrapper around it. Is it possible that VoIPPushNotification is in the window variable?

@Haroon6138
Copy link
Author

Haroon6138 commented Mar 17, 2020

@mattkhaw i got it to work, now the problem that i am having is the "didUpdatePushCredentials" is never called, hence i am unable to get the token. I have completed all the requirements for this like generating the cert & pem file & everything, but still not working.
I also saw ur Github plugin "cordova-plugin-callkit", i tried it but still the same, It would be a huge help if i can get an example for ionic 4.

@mattkhaw
Copy link

@Haroon6138 My plugin is the same as @Hitman666's. So, the result would be the same. If you can get it to work, means it will work, otherwise no. If you've setup the Apple Developer console portion, it will work.

What I think is maybe you setup for the wrong app? That might be the answer. If you got the plugin to work, there's no reason it cannot get a token unless the setup is wrong. This is what I've experience setting up not only Apple PushKit but for other frameworks as well. I couldn't help you much on Ionic 4 since I don't use Ionic but Ionic will work similarly with Cordova based on what I've experienced so far. I did do some Ionic stuff previously, so that's why I said it is similar to Cordova.

My suggestion is double check the bundle ID and make sure VOIP services is enabled for that app. That's the only problem I see so far. The other possibility is on the native side, maybe there's some capabilities that you haven't enable yet. Make sure VOIP and remote notifications are enabled.

@Haroon6138
Copy link
Author

@mattkhaw i'll check all the configurations again But i am sure that i have done them all correctly as i have followed the instructions from around 8 10 tutorials

@ganeshpotnuru
Copy link

@Haroon6138 , can you post your answer here, what you did to resolve the issue "Cannot find name 'VoIPPushNotification'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants