1.2.0 • Published 8 years ago

nativescript-messenger v1.2.0

Weekly downloads
18
License
MIT
Repository
github
Last release
8 years ago

NativeScript Messenger

A NativeScript module providing an sms messaging action for iOS and Android.

Installation

Run tns plugin add nativescript-messenger

Usage

To use the messenger module you must first require() it.

var messenger = require( "nativescript-messenger" );

Method

####send: Sends a message to one or multiple recipients

Parameters
  • numbers: An array of phone number strings. Supports just one or multiple.
  • message: The body message.
  • subject: The subject message.
var messenger = require( "nativescript-messenger" );
var numbers = ["905-454-1234", "905-454-4321", "905-929-1122"];
messenger.send(numbers, "My message", "Subject of Message");

This method also returns a promise. Use as so to define actions after the user has either canceled or sent the message.

    messenger.send(["905-555-5555", "905-555-4444"], "this is body").then(function(args){
        console.log(args.response); 
        // either a string saying cancelled or sent
        console.log(args.message); 
        // just a string with more detail than response.
        
        /* you can do stuff here.. this happens back 
        in your app after the message window has 
        been dismissed */        
        
    }, function (e) {
        console.log("Error occurred " + e); 
        // e will show a vague error message.
    });    
1.2.0

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.6

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago