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

Error while using this for IONIC app #6

Open
BasuSharma opened this issue Mar 20, 2017 · 4 comments
Open

Error while using this for IONIC app #6

BasuSharma opened this issue Mar 20, 2017 · 4 comments

Comments

@BasuSharma
Copy link

Hi,
I am getting error as - \SmsReceiverPlugin.java:8: error: package android.support.v4.app does not exist while building an ionic app just after installing this plugin and adding given code.
Any help would be appreciated.

Thanks
Basu

@rosi92b
Copy link

rosi92b commented Apr 4, 2017

Hi, I'm getting the same error as yours. Thus I was wondering if you were able to solve it.
Thanks.
Rosi

@BasuSharma
Copy link
Author

BasuSharma commented Apr 4, 2017

Hey Rosi,
I didn't get any solution to above error. But I found another plugin here, which works for me perfectly, so instead of waiting here for this issue to be resolved I used other plugin.
** Use smsrec.Method_Name()
You can also give a shot to this. Hope it helps.
Thanks
Basu

@rosi92b
Copy link

rosi92b commented Apr 4, 2017

I have another issue to ask you.
In the 3rd step the github page of the plugin said:
Add the java files from src to your project's src hierarchy.
Well, I've extracted all the files where I have to paste exaclty the java files? Can you tell me the path in the ionic project?
thanks a lot.

@BasuSharma
Copy link
Author

BasuSharma commented Apr 4, 2017

Hi Rosi,
Hope you are having a nice day. Sorry for the delay in response.
For ionic project you need not to do that.
just run below command
cordova plugin add https://github.com/softdive/cordova-plugin-sms.git --save

and the plugin will get installed inside your project_root/plugins directory.
Then you can directly use it in either controller.js or app.js or services.js etc... as smsrec.method_name()....... or navigator.smsrec.method_name()....
below is the sample code, which worked for me-
navigator.smsrec.startReception (function(msg) {
console.log('message '+ JSON.stringify(msg));
// format - {"address":"+XXXXXXXXXX","body":"Hello sweet girl","date":1490348584250}
}, function(err){console.log("err"+ err);
});

In the github pages steps are for phonegap app I guess.
Ionic is much simpler..

Also you can send your queries to [email protected] rather than here, as it is for someone else' plugin issues.

Happy to help anytime.

Thanks
Basu

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

2 participants