All Projects → hanatharesh2712 → ionic-native-sms-retriever-plugin-master

hanatharesh2712 / ionic-native-sms-retriever-plugin-master

Licence: other
Cross-platform plugin for Cordova / PhoneGap to Retrieve SMS. Available for Android.

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ionic-native-sms-retriever-plugin-master

ionic-hockeyapp
Need HockeyApp in your Ionic application, add this package!
Stars: ✭ 19 (+18.75%)
Mutual labels:  cordova, ionic, cordova-plugin, ionic-framework, ionic-cordova, ionic3
cordova-plugin-flurryanalytics
Adds support for all that Flurry Analytics flavored goodness to your Cordova based apps
Stars: ✭ 23 (+43.75%)
Mutual labels:  cordova, ionic, cordova-plugin, phonegap-plugin
ionic4-angular6-crud-example
Building CRUD Mobile App using Ionic 4, Angular 6 and Cordova
Stars: ✭ 50 (+212.5%)
Mutual labels:  cordova, ionic, ionic-framework, ionic3
cordova-plugin-today-widget
Add a today widget app extension target to your cordova project.
Stars: ✭ 51 (+218.75%)
Mutual labels:  cordova, ionic, cordova-plugin, ionic3
todo-list
TodoList using Ionic2/3 & Firebase: * PWA * SSO Google plus. * Share list via QRcode. * Upload image from Camera or Storage. * Speech Recognition.
Stars: ✭ 18 (+12.5%)
Mutual labels:  cordova, ionic, ionic-framework, ionic3
Ionic Native
Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support.
Stars: ✭ 2,129 (+13206.25%)
Mutual labels:  cordova, ionic, cordova-plugin, ionic-framework
Awesome Ionic
An "awesome" list of Ionic resources
Stars: ✭ 799 (+4893.75%)
Mutual labels:  cordova, ionic, ionic-framework, ionic3
ionic-3-video-calling-using-webrtc
This is demo code of how to implement video calling in ionic 3 using webrtc
Stars: ✭ 58 (+262.5%)
Mutual labels:  cordova, ionic, ionic-framework, ionic3
Ionic4
This repo contains example code for ionic4. Get Step by Step tutorial of this repo examples using https://ampersandacademy.com/tutorials/ionic-framework-4
Stars: ✭ 37 (+131.25%)
Mutual labels:  cordova, ionic, cordova-plugin, ionic-framework
Wooionic3
An eCommerce App for WooCommerce stores using Ionic 3.
Stars: ✭ 208 (+1200%)
Mutual labels:  cordova, ionic, ionic-framework, ionic3
cordova-plugin-dbcopy
Copy SQLite Database from www folder to default app database location
Stars: ✭ 90 (+462.5%)
Mutual labels:  cordova, cordova-plugin, phonegap-plugin
ionic3-start-theme
Ionic 3 Start Theme with 10 Pages, mock data, providers samples, Storage, Http and more...
Stars: ✭ 130 (+712.5%)
Mutual labels:  ionic, ionic-framework, ionic3
example-cordova-code-push-plugin
Ionic + Cordova Code Push Plugin Example
Stars: ✭ 45 (+181.25%)
Mutual labels:  cordova, ionic, cordova-plugin
ionic3-angular4-sample-app
Sample app of Ionic 3 and Angular 4
Stars: ✭ 35 (+118.75%)
Mutual labels:  cordova, ionic, ionic3
ionic-login-component
Free sample of Premium Ionic Login Component
Stars: ✭ 17 (+6.25%)
Mutual labels:  ionic, ionic-framework, ionic3
ionic-app-with-aws-cognito
Angular 4, Ionic 3, and AWS (Amazon) Cognito User Pools. Authentication out of the box.
Stars: ✭ 62 (+287.5%)
Mutual labels:  ionic, ionic-framework, ionic3
ionic4-angular7-example
Ionic 4, Angular 7 and Cordova Tutorial: Build CRUD Mobile Apps
Stars: ✭ 57 (+256.25%)
Mutual labels:  cordova, ionic, ionic-framework
ionic-facebook-login
Ionic starter app to show you how to add Facebook Log In to an Ionic App.
Stars: ✭ 69 (+331.25%)
Mutual labels:  ionic, ionic-framework, ionic-cordova
cordova-plugin-apkupdater
This plugin allows your Android app to download and install compressed updates without the Google Play Store.
Stars: ✭ 46 (+187.5%)
Mutual labels:  cordova, ionic, cordova-plugin
keyonic-v2
A Keycloak Mobile Implementation using Angular v4 and Ionic v3
Stars: ✭ 23 (+43.75%)
Mutual labels:  cordova, ionic, ionic-framework

ionic-native-sms-retriever-plugin-master

Cordova SMS retriver Plugin

Cross-platform plugin for Cordova / PhoneGap to to easily retrive SMS for your APP without need permission of SMS_READ. Available for Android.

Installing the plugin

Using the Cordova CLI run:

ionic cordova plugin add cordova-plugin-sms-retriever-manager
npm install @ionic-native/sms-retriever

It is also possible to install via repo url directly (unstable), run :

ionic cordova plugin add https://github.com/hanatharesh2712/ionic-native-sms-retriever-plugin-master.git

You can find working Demo for Cordova here: https://github.com/hanatharesh2712/automatic-sms-cordova/tree/main/hello

Using the plugin

HTML

 <input type="button" class="hashCode" value="Get App Hash" />
 <input type="button" class="startWatching" value="Start watching SMS" />

Javascript

document.querySelector('.hashCode').addEventListener('click', this.getAppHash);
document.querySelector('.startWatching').addEventListener('click', this.retriveSMS);

var app = {
       getAppHash: function() {
        window['cordova']['plugins']['smsRetriever']['getAppHash'](
        (result) => { 
            // Once you get this hash code of your app. Please remove this code.
            alert(result);
            console.log('Hash', result);
        },
        (err) => {
            console.log(err);
        });
    }, 

    retriveSMS: function() {
        window['cordova']['plugins']['smsRetriever']['startWatching'](
      // the first callback is the success callback. We got back the native code’s result here.
      (result) => { 
        alert(result.Message);
		console.log('Message', result);
	  },
      // the second is the error callback where we get back the errors
      (err) => {
        console.log(err);
      });
    }
};

You can find working Demo for Ionic 4 here: https://github.com/hanatharesh2712/sms-plugin-test

Typescript (Ionic 4)

  import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
 
 
  constructor(private smsRetriever: SmsRetriever) { }
 
  ...
 
 // This function is to get hash string of APP.
 // * @return {Promise<string>} Returns a promise that resolves when successfully generate hash of APP.
  this.smsRetriever.getAppHash()
    .then((res: any) => console.log(res))
    .catch((error: any) => console.error(error));


// * This function start wathching message arrive event and retrive message text.
// * @return {Promise<string>} Returns a promise that resolves when retrives SMS text or TIMEOUT after 5 min.
   this.smsRetriever.startWatching()
    .then((res: any) => console.log(res))
    .catch((error: any) => console.error(error));
 

You can find working Demo for Ionic 3 here: https://github.com/hanatharesh2712/sms-plugin-test-ionic-3

Typescript (Ionic 3)

import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
var smsRetriever = window['cordova']['plugins']['smsRetriever'];
 
  public smsTextmessage: string = '';
  public appHashString: string = '';
  constructor(private smsRetriever: SmsRetriever) { }
 
  ...
 
  getHashCode() {
    smsRetriever['getAppHash']((res) => {
      this.appHashString = res;
      console.log(res);
    }, (err) => {
      console.warn(err);
    }
    );
  }

  getSMS() {
    smsRetriever['startWatching']((res) => {
      this.smsTextmessage = res.Message;
      console.log(res);
    }, (err) => {
      console.warn(err);
    }
    );
  }

Flow to test: flow

You need to send your application hash in SMS when you are sending from your backend. to generate the hash of your application read this: https://developers.google.com/identity/sms-retriever/verify

To get your application hash code:

  • Without the correct hash, your app won't recieve the message callback. This only needs to be
  • generated once per app and stored. Then you can remove this function from your code.

BUILD FAILED

The problem is that you need to make sure that you set the target to android-19 or later in your ./platforms/android/project.properties file like this:

# Project target.
target=android-19

Donations

If your app is successful or if you are working for a company, please consider donating some beer money 🍺:

paypal

Keep in mind that I am maintaining this repository on my free time so thank you for considering a donation. 👍

Contributing

I believe that everything is working, feel free to put in an issue or to fork and make pull requests if you want to add a new feature.

Things you can fix:

  • Allow for null number to be passed in Right now, it breaks when a null value is passed in for a number, but it works if it's a blank string, and allows the user to pick the number It should automatically convert a null value to an empty string

Thanks for considering contributing to this project.

Finding something to do

Ask, or pick an issue and comment on it announcing your desire to work on it. Ideally wait until we assign it to you to minimize work duplication.

Reporting an issue

  • Search existing issues before raising a new one.

  • Include as much detail as possible.

Pull requests

  • Make it clear in the issue tracker what you are working on, so that someone else doesn't duplicate the work.

  • Use a feature branch, not master.

  • Rebase your feature branch onto origin/master before raising the PR.

  • Keep up to date with changes in master so your PR is easy to merge.

  • Be descriptive in your PR message: what is it for, why is it needed, etc.

  • Make sure the tests pass

  • Squash related commits as much as possible.

Coding style

  • Try to match the existing indent style.

  • Don't mix platform-specific stuff into the main code.

History

License

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].