{"_id":"sns-mobile","_rev":"32-3ae4fb8925019ebada746855936b30fc","name":"sns-mobile","description":"Send push notifications to Android, Kindle Fire, and iOS devices easily.","dist-tags":{"latest":"1.3.1"},"versions":{"0.0.0":{"name":"sns-mobile","version":"0.0.0","description":"Push notifications to Android and iOS devices easily using this module.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":"","author":{"name":"Evan Shortiss"},"license":"MIT","keywords":["sns","amazon","aws","apns","gcm","push","notification","notification"],"dependencies":{"async":"*","aws-sdk":"2.0.0-rc3"},"_id":"sns-mobile@0.0.0","dist":{"shasum":"0db87b14ac27b29b993e5620977b723f454481ad","tarball":"https://registry.npmjs.org/sns-mobile/-/sns-mobile-0.0.0.tgz","integrity":"sha512-VhywRS+ert+PPwJtNDBLtUOdah6Q0Y/TIakLLJTKIANhWymz5lI5Fi7tJ+om2SbYNGZRAIbgkZGzQQfLPZOKfQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDu8ZaCv1kyFnW7PGiEhs9yPTyAGo/TifC/dH40DSQpZgIgB2aYE9RjFJOQgmt5/UGOddzVLHob41eHvLvJ4Ptpx40="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"evanshortiss","email":"evanshortiss@gmail.com"},"maintainers":[{"name":"evanshortiss","email":"evanshortiss@gmail.com"}],"directories":{}},"0.0.2":{"name":"sns-mobile","version":"0.0.2","description":"Push notifications to Android and iOS devices easily using this module.","main":"index.js","scripts":{"test":"mocha test/"},"repository":"","author":{"name":"Evan Shortiss"},"license":"MIT","keywords":["sns","amazon","aws","apns","gcm","push","notification","simple notification service"],"dependencies":{"async":"0.2.10","aws-sdk":"2.0.0-rc3"},"_id":"sns-mobile@0.0.2","dist":{"shasum":"1460c36e9d76108b31e0207d6a0ce4294699e4bc","tarball":"https://registry.npmjs.org/sns-mobile/-/sns-mobile-0.0.2.tgz","integrity":"sha512-8WEefTiCKX83XUwZFu74oBrcaxHGFvOkvly7GHBTj28wg4j757UDBgijmjOEw2tGFtojXV7RaZGXtcWPAg7kuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+OkigLYgoB/q6if/8V4GHZWNU8IMPWoC/B4pQqKIeMAIgVfvLlA38F+iJ/6OlIikuguk62vxXNqDCEcMkIg4+KsI="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"evanshortiss","email":"evanshortiss@gmail.com"},"maintainers":[{"name":"evanshortiss","email":"evanshortiss@gmail.com"}],"directories":{}},"0.0.3":{"name":"sns-mobile","version":"0.0.3","description":"Push notifications to Android and iOS devices easily using this module.","main":"index.js","scripts":{"test":"mocha test/"},"repository":"","author":{"name":"Evan Shortiss"},"license":"MIT","keywords":["sns","amazon","aws","apns","gcm","push","notification","simple notification service"],"dependencies":{"async":"0.2.10","aws-sdk":"2.0.0-rc3"},"_id":"sns-mobile@0.0.3","dist":{"shasum":"cdbeefdb03d08e77ac265b6a0ae5a6e5ab1b6e6c","tarball":"https://registry.npmjs.org/sns-mobile/-/sns-mobile-0.0.3.tgz","integrity":"sha512-+79ljmhF1j3als/RBesBTB5Xf5+7RyJnyfeynBXKZ5hrv7VrMJFnPqiWDRr3jg36E7GLzwKv1q9Y4j5Ea4qNVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8SXGQ/HA6MxcQHgRGnpDTLd7kUIKanJDw6PS3CBl51wIgKWhGE3G+rRaDrjxDwYNshxZUCaIY9vz3ujw8Bvvbb8Y="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"evanshortiss","email":"evanshortiss@gmail.com"},"maintainers":[{"name":"evanshortiss","email":"evanshortiss@gmail.com"}],"directories":{}},"1.0.2":{"name":"sns-mobile","version":"1.0.2","description":"Push notifications to Android, Kindle Fire, and iOS devices easily using this module.","main":"index.js","scripts":{"test":"mocha test/"},"bugs":{"url":"https://github.com/evanshortiss/sns-mobile/issues"},"repository":{"type":"git","url":"https://github.com/evanshortiss/sns-mobile"},"author":{"name":"Evan Shortiss"},"license":"MIT","keywords":["sns","amazon","aws","apns","gcm","push","notification","simple notification service"],"dependencies":{"async":"0.2.10","aws-sdk":"2.0.0-rc3"},"devDependencies":{"linelint":"0.0.3","lintspaces-cli":"0.0.4","mocha":"^1.21.4","jshint":"^2.5.6"},"homepage":"https://github.com/evanshortiss/sns-mobile","_id":"sns-mobile@1.0.2","dist":{"shasum":"e80dfaa00d338d7ac48d7f9f30357a4ae9dd38dd","tarball":"https://registry.npmjs.org/sns-mobile/-/sns-mobile-1.0.2.tgz","integrity":"sha512-HO2qcXS7FGJnvmOreUT9gwZBtufRXhsfQuUc0BbIrhx1THrOLaCD7IRVpkGQ+u/RT/E9ByBDQTCqZAv+L2GvuA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErN7rT2oHCB/qtb/3XJatiH+unDqnqfWkkk2wQ2iJe1AiA2O7oOk32dwbqVaIOD5YMAoN/zs3q4q+bEGn4l4BqUiQ=="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"evanshortiss","email":"evanshortiss@gmail.com"},"maintainers":[{"name":"evanshortiss","email":"evanshortiss@gmail.com"}],"directories":{}},"1.1.0":{"name":"sns-mobile","version":"1.1.0","description":"Push notifications to Android, Kindle Fire, and iOS devices easily using this module.","main":"index.js","scripts":{"test":"mocha test/"},"bugs":{"url":"https://github.com/evanshortiss/sns-mobile/issues"},"repository":{"type":"git","url":"https://github.com/evanshortiss/sns-mobile"},"author":{"name":"Evan Shortiss"},"license":"MIT","keywords":["sns","amazon","aws","apns","gcm","push","notification","simple notification service"],"dependencies":{"async":"0.2.10","aws-sdk":"2.0.0-rc3"},"devDependencies":{"linelint":"0.0.3","lintspaces-cli":"0.0.4","mocha":"^1.21.4","jshint":"^2.5.6"},"homepage":"https://github.com/evanshortiss/sns-mobile","_id":"sns-mobile@1.1.0","dist":{"shasum":"d2cb4a1e5124a2a428ac2f484f2c20b003095a9f","tarball":"https://registry.npmjs.org/sns-mobile/-/sns-mobile-1.1.0.tgz","integrity":"sha512-Eqa4S1RwShxz9auSaqaVxIkwyuw5HYbc0ZphIwh6TIsgjoMAxE0nSjG9SOol0bEG5GSkOCwjuZx7fW8hkFkuvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGajY6cBcpjKZFmgu193caBEFLWvKP2cRJjY9qIiUV0vAiAZ9CiJYpmTg1hatdPD8q46xj48rPzLPQmNABZEAIin0g=="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"evanshortiss","email":"evanshortiss@gmail.com"},"maintainers":[{"name":"evanshortiss","email":"evanshortiss@gmail.com"}],"directories":{}},"1.2.0":{"name":"sns-mobile","version":"1.2.0","description":"Send push notifications to Android, Kindle Fire, and iOS devices easily.","main":"index.js","scripts":{"test":"mocha test/","test-debug":"mocha --debug-brk test/"},"bugs":{"url":"https://github.com/evanshortiss/sns-mobile/issues"},"repository":{"type":"git","url":"https://github.com/evanshortiss/sns-mobile"},"author":{"name":"Evan Shortiss"},"license":"MIT","keywords":["sns","amazon","aws","apns","gcm","kindle","fire","push","ios","android","notification","simple notification service"],"dependencies":{"async":"0.2.10","aws-sdk":"2.1.5"},"devDependencies":{"linelint":"0.0.3","lintspaces-cli":"0.0.4","mocha":"^1.21.4","jshint":"^2.5.6"},"gitHead":"f4f336d23e809e632b3af3e50990ec69af09b258","homepage":"https://github.com/evanshortiss/sns-mobile","_id":"sns-mobile@1.2.0","_shasum":"d9e6c43c8f9aa8ecd210db2e76809c29a20bd64f","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.10.24","_npmUser":{"name":"evanshortiss","email":"evanshortiss@gmail.com"},"maintainers":[{"name":"evanshortiss","email":"evanshortiss@gmail.com"}],"dist":{"shasum":"d9e6c43c8f9aa8ecd210db2e76809c29a20bd64f","tarball":"https://registry.npmjs.org/sns-mobile/-/sns-mobile-1.2.0.tgz","integrity":"sha512-xGU5sOgX+2lo+8OzwUsc9qgmjLxxcVGhUzGlKbCvJ1zWphO47A1AkA1FaeMWil1P+qabr/FKwV2YC2wNEv0XqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBDTFbIh8nPrsvnUYHttL/xwjMZPwk/CH14kBhtOFycIAiAffdEPQPfXtwReAB064N2fGoK0or5ChvGdoRpaM3prrQ=="}]},"directories":{}},"1.3.0":{"name":"sns-mobile","version":"1.3.0","description":"Send push notifications to Android, Kindle Fire, and iOS devices easily.","main":"index.js","scripts":{"test":"mocha test/","test-debug":"mocha --debug-brk test/"},"bugs":{"url":"https://github.com/evanshortiss/sns-mobile/issues"},"repository":{"type":"git","url":"https://github.com/evanshortiss/sns-mobile"},"author":{"name":"Evan Shortiss"},"license":"MIT","keywords":["sns","amazon","aws","apns","gcm","kindle","fire","push","ios","android","notification","simple notification service"],"dependencies":{"async":"0.2.10","aws-sdk":"2.1.5"},"devDependencies":{"linelint":"0.0.3","lintspaces-cli":"0.0.4","mocha":"^1.21.4","jshint":"^2.5.6"},"gitHead":"e73b7993c3c570e4ba46c9cea02c70179caff87c","homepage":"https://github.com/evanshortiss/sns-mobile","_id":"sns-mobile@1.3.0","_shasum":"4527494360920c8b3ccc166503d30c98cdc58569","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.10.24","_npmUser":{"name":"evanshortiss","email":"evanshortiss@gmail.com"},"maintainers":[{"name":"evanshortiss","email":"evanshortiss@gmail.com"}],"dist":{"shasum":"4527494360920c8b3ccc166503d30c98cdc58569","tarball":"https://registry.npmjs.org/sns-mobile/-/sns-mobile-1.3.0.tgz","integrity":"sha512-dmfAAHNYkUwu9Mbvir99Rx5+nFdkZWB/q2sVI57DBmkHHk012WOadJ18YS/qMtkiolA2n0ey+ZphlvZpuy4k7w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFNx2DVvQaSDneHM+w6T8weP551vjmE0G6HMopZl/7h0AiBHNzAYw4lMA+VDkYSwOGUnwAL7xeNIYiJr2ZiVTjg6nw=="}]},"directories":{}},"1.3.1":{"name":"sns-mobile","version":"1.3.1","description":"Send push notifications to Android, Kindle Fire, and iOS devices easily.","main":"index.js","scripts":{"test":"mocha test/","test-debug":"mocha --debug-brk test/"},"bugs":{"url":"https://github.com/evanshortiss/sns-mobile/issues"},"repository":{"type":"git","url":"git+https://github.com/evanshortiss/sns-mobile.git"},"author":{"name":"Evan Shortiss"},"license":"MIT","keywords":["sns","amazon","aws","apns","gcm","kindle","fire","push","ios","android","notification","simple notification service"],"dependencies":{"async":"^0.2.10","aws-sdk":"^2.1.5"},"devDependencies":{"linelint":"0.0.3","lintspaces-cli":"0.0.4","mocha":"^1.21.4","jshint":"^2.5.6"},"gitHead":"951dca6c90380ea8dd52dd2c8d229a2133f28860","homepage":"https://github.com/evanshortiss/sns-mobile#readme","_id":"sns-mobile@1.3.1","_nodeVersion":"14.3.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-sTLKYKGlGc6GQcSOLt3EMmxNBbPCU3vrhUFN9CoFoGbzrWtUvOg8wKpz0itoTQp41gIq13YDJVjU+ujitzriEg==","shasum":"c063b051ea4c943af4971ff773d403f48d3cee62","tarball":"https://registry.npmjs.org/sns-mobile/-/sns-mobile-1.3.1.tgz","fileCount":8,"unpackedSize":43060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7BPACRA9TVsSAnZWagAAPZ4QAINDmg+l1Gtz79kK9Upq\ndJR+HSBxDfmdhPkHC4y45EDoWnRWXspooeU39L7Mxkc7efLH6hEJTBLXa2Kd\n7nQPqzR87Lb4yKgD/JMrLT6Vq+KISui56i2a736EPeH4H/+0KGV9jJOaIRsa\nJ9fcAglri2Nc07M8pHH2uwAOuS8cgBU8DPf5ktMYLJ0rroYi2HH5mKVNT8uR\nfoAXObHVcdOxJjhKN5wgxAqdfaBsacg3Tu05TWP/+WUaG0swk5mep/BfsXuT\nx/V145tIdMD1uzb5MXDVtY/GrFUJQQUXdGdZSYrxkZ/2MbZji3U5rkA47P00\nx6ehAYLMWK32K1PYPPcmxhZx19zmd4n8hhJoVqKlE0k8kVfHxQZTPQZdcxD1\nA1HBdDVQrqper3vgZtuV9qzqQPwv0n5Y5mAi0YQ0uCi3Q1Fg2ZG2gD5Sok5E\nq4XAwzgqzubNNFJvPR0yc5EDVvp3vjBRNCB3OpkXCRXnEYXOjIKy9gblA6+4\nv3ravI4rJbLASWoTVIGNUQKWb4Tzo5F4ZgDYCYRfe8mEoeQBlzO3yfH0dpYJ\nPfw1f28WiX2JjBG+TeWqxQDmIa6h20CSPEDQG3+JYvgIY0RCxbiOZ1dlMSim\na2amqQkfw9mooB+xB9pcgiTKEJfr+xwo7NwEPY005SjextQavyb6R4aWv5qS\n9qRY\r\n=LwQx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFikmlPnlz15obUlOa//vQyqpV84W8rqJt6p5cYrOTiIAiBn5e+bEuzZMnxzQkap1BB4Db/8k8ts1fcbmbz44lMFrg=="}]},"_npmUser":{"name":"evanshortiss","email":"evanshortiss@gmail.com"},"directories":{},"maintainers":[{"name":"evanshortiss","email":"evanshortiss@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sns-mobile_1.3.1_1626084287977_0.4623592205282916"},"_hasShrinkwrap":false}},"readme":"# Maintainer(s)\n\nI no longer use this and haven't got the capacity to maintain it.\nIf you'd like to be a maintainer of this library please get in touch.\n\n# SNS Mobile Push\n\nModule to make interacting with mobile push notifications for iOS and Android easier. Wraps the Amazon aws-sdk node module. The idea is that you can create an object to represent each Platform Application you plan to use and remove the excess features that aren't needed for Android and iOS applications.\n\n## Installation\n\n```sh\nnpm install sns-mobile\n```\n\n## Setting Up a User for SNS\nTo use Amazon SNS you need a Secret Access Key and an Access Key Id. Getting these will require you to create a user under the IAM section of AWS and attach a User Policy with the following Policy Document:\n\n*Disclaimer: I'm not an AWS ninja, this configuration may be too liberal but it works!*\n\n```\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"AccessToSNS\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"sns:*\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    }\n  ]\n}\n```\n\n## Simple Code Example for Android\nThe below example creates an SNS instance for an Android application identified by a PlatformApplicationArn.\n\n```javascript\nvar SNS = require('sns-mobile'),\n    EVENTS = SNS.EVENTS;\n\nvar SNS_KEY_ID = process.env['SNS_KEY_ID'],\n  SNS_ACCESS_KEY = process.env['SNS_ACCESS_KEY'],\n  ANDROID_ARN = process.env['SNS_ANDROID_ARN'];\n\nvar androidApp = new SNS({\n  platform: SNS.SUPPORTED_PLATFORMS.ANDROID,\n  region: 'eu-west-1',\n  apiVersion: '2010-03-31',\n  accessKeyId: SNS_KEY_ID,\n  secretAccessKey: SNS_ACCESS_KEY,\n  platformApplicationArn: ANDROID_ARN,\n  //sandbox: true (This is required for targetting (iOS) APNS_SANDBOX only)\n});\n\n// Add a user, the endpointArn is their unique id\n// endpointArn is required to send messages to the device\nandroidApp.addUser('some_fake_deviceid_that_i_made_up', JSON.stringify({\n  some: 'extra data'\n}), function(err, endpointArn) {\n  if(err) {\n    throw err;\n  }\n\n  // Send a simple String or data to the client\n  androidApp.sendMessage(endpointArn, 'Hi There!', function(err, messageId) {\n    if(err) {\n      throw err;\n    }\n\n    console.log('Message sent, ID was: ' + messageId);\n  });\n});\n```\n\n## Running Tests\n\n```sh\nSNS_KEY_ID=\"<your_sns_key_id>\" SNS_ACCESS_KEY=\"<your_sns_access_key>\" SNS_ANDROID_ARN=\"arn:aws:sns:...\" npm test\n```\n\n## Events Emitted\nInstances created will emit events as listed below and callbacks should have the shown format. Event strings can be accessed as shown below.\n\n```\nvar SNS = require('sns-mobile'),\n    EVENTS = SNS.EVENTS;\n\n// EVENTS.SENT_MESSAGE\n// EVENTS.BROADCAST_END\n// EVENTS.BROADCAST_START\n// EVENTS.FAILED_SEND\n// EVENTS.DELETED_USER\n// EVENTS.ADD_USER_FAILED\n// EVENTS.ADDED_USER\n// EVENTS.ATTRIBUTES_UPDATE_FAILED\n// EVENTS.ATTRIBUTES_UPDATED\n// EVENTS.TOPIC_CREATED\n// EVENTS.CREATE_TOPIC_FAILED\n// EVENTS.TOPIC_DELETED\n// EVENTS.DELETE_TOPIC_FAILED\n// EVENTS.SUBSCRIBED\n// EVENTS.SUBSCRIBE_FAILED\n// EVENTS.UNSUBSCRIBED\n// EVENTS.UNSUBSCRIBE_FAILED\n// EVENTS.PUBLISH_FAILED\n// EVENTS.PUBLISHED_MESSAGE\n\nvar myApp = new SNS({\n  platform: SNS.SUPPORTED_PLATFORMS.ANDROID,\n  region: 'eu-west-1',\n  apiVersion: '2010-03-31',\n  accessKeyId: SNS_ACCESS_KEY,\n  secretAccessKey: SNS_KEY_ID,\n  platformApplicationArn: ANDROID_ARN\n  // sandbox: true/false (If we're targetting Apple dev/live APNS)\n});\n\nmyApp.on(EVENTS.ADDED_USER, function(endpointArn, deviceId){\n    // Save user details to a db\n});\n```\n\n#### broadcastStart\n```\nfunction () {}\n```\nEmitted prior to broadcasting the first message.\n\n#### broadcastEnd\n```\nfunction () {}\n```\nEmitted once all messages are broadcast.\n\n#### messageSent\n```\nfunction (endpointArn, res.MessageId) {}\n```\nEmitted when a message sends successfully.\n\n#### userDeleted\n```\nfunction (endpointArn) {}\n```\nWhen a user is deleted this is emitted.\n\n#### sendFailed\n```\nfunction (endpointArn, err) {}\n```\nIf a message fails to send this is emitted.\n\n#### addUserFailed\n```\nfunction(deviceToken, err)\n```\nFired when adding a user fails.\n\n#### userAdded\n```\nfunction (endpointArn, deviceId) {}\n```\nWhen a user is added this is emitted.\n\n#### attributesUpdateFailed\n```\nfunction (endpointArn, err) {}\n```\nIf updating the attributes for an endpoint fails this is emitted.\n\n#### attributesUpdated\n```\nfunction (endpointArn, attributes) {}\n```\nWhen an endpoint's attributes are updated this is emitted.\n\n#### topicCreated\n```\nfunction (topicArn, topicName) {}\n```\nEmitted when a topic has been created successfully.\n\n#### createTopicFailed\n```\nfunction (topicName) {}\n```\nEmitted when an attempt to create a topic has failed.\n\n#### topicDeleted\n```\nfunction (topicArn) {}\n```\nEmitted when a topic has been deleted successfully.\n\n#### deleteTopicFailed\n```\nfunction (topicArn) {}\n```\nEmitted when an attempt to delete a topic has failed.\n\n#### subscribed\n```\nfunction (subscriptionArn, endpointArn, topicArn) {}\n```\nEmitted when an endpoint has been subscribed to a topic successfully.\n\n#### subscribeFailed\n```\nfunction (endpointArn, topicArn, err) {}\n```\nEmitted when an attempt to subscribe an endpoint to a topic has failed.\n\n#### unsubscribed\n```\nfunction (subscriptionArn) {}\n```\nEmitted when an endpoint has been unsubscribed from a topic successfully.\n\n#### unsubscribeFailed\n```\nfunction (subscriptionArn, err) {}\n```\nEmitted when an attempt to unsubscribe an endpoint from a topic has failed.\n\n#### publishedMessage\n```\nfunction (topicArn, messageId) {}\n```\nEmitted when a message has been published to a topic successfully.\n\n#### publishFailed\n```\nfunction (topicArn, err) {}\n```\nEmitted when an attempt to publish a message to a topic has failed.\n\n## API\n\n#### SNS(opts)\nExpects an object with the following params:\n* platform: Supply any of the platforms in SNS.SUPPORTED_PLATFORMS\n* region: The Amazon region e.g 'eu-west-1'\n* apiVersion: Amazon API version, I have only used '2010-03-31'\n* accessKeyId: Amazon user Access Key.\n* secretAccessKey: Amazon user Secret Access Key.\n* platformApplicationArn: The PlatformApplicationArn for the Platform Application the interface operates on.\n* sandbox: Set this to true to target the Apple APNS_SANDBOX environment with messages.\n\n#### SUPPORTED_PLATFORMS\nAn object containing supported platforms. Available options are:\n\n* SUPPORTED_PLATFORMS.ANDROID\n* SUPPORTED_PLATFORMS.IOS\n* SUPPORTED_PLATFORMS.KINDLE_FIRE\n\n#### getPlatformApplicationArn()\nReturns the platformApplicationArn provided to the constructor.\n\n#### getRegion()\nReturns the region being used.\n\n#### getApiVersion()\nReturns apiVersion being used.\n\n#### getApplications(callback)\nGet all Platform Applications. This will not allow you to interface with other PlatformApplications but may be useful to just get a list of you applications. Callback format callback(err, users)\n\n#### getUser(endpointArn, callback)\nGet a user via endpointArn. The callback(err, user) receives an Object containg Attributes for the user and the EndpointArn.\n\n#### getUsers(callback)\nGet all users, this could take a while due to a potentially high number of requests required to get each page of users. The callback(err, users) receives an Array containing users.\n\n#### getTopics(callback)\nGet all topics by paging through them. The callback(err, topics) receives an Array containing topic objects.\n\n#### getSubscriptions(topicArn, callback)\nGet all subscriptions for the topic with the given topicArn by paging through them. The callback(err, subscriptions) receives an Array containing subscription objects.\n\n#### addUser(deviceToken, [data], callback)\nAdd a device/user to SNS with optional extra data. Callback has format fn(err, endpointArn).\n\n#### createTopic(name, callback)\nCreate a new topic with the given name. The callback has the format fn(err, topicArn).\n\n#### setAttributes(endpointArn, attributes, callback)\nUpdate an existing endpoint's attributes. Attributes is an object with the following optional properties:\n\n* CustomUserData: <object|string>\n* Enabled: <string>\n* Token: <string>\n\nCallback has format fn(err, attributes).\n\n#### deleteUser(endpointArn, callback)\nDelete a user from SNS. Callback has format callback(err)\n\n#### deleteTopic(topicArn, callback)\nDelete the topic with the given topicArn. The callback has the format fn(err).\n\n#### sendMessage(endpointArn, message, callback)\nSend a message to a user. The _message_ parameter can be a String, or an Object with the formats below. The callback format is callback(err, messageId).\n\n#### subscribe(endpointArn, topicArn, callback)\nSubscribe an endpoint to a topic. The callback has the format fn(err, subscriptionArn).\n\n#### unsubscribe(subscriptionArn, callback)\nUnsubscribe an endpoint from a topic via the given subscriptionArn. The callback has the format fn(err).\n\n#### publishToTopic(topicArn, message, callback)\nPublish a message a topic. The callback has the format fn(err, messageId).\nPlease note that the message *must* be in the final Amazon SNS format as\nspecified [here](http://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-custommessage.html#mobile-push-send-multiplatform), i.e. it\n*must* contain a key called `default` and platform-specific messages *must* already be JSON-stringified. Example:\n\n```json\n{\n  \"default\": \"Default message which must be present when publishing a message to a topic. Will only be used if a message is not present for one of the notification platforms.\",\n  \"APNS\": \"{\\\"aps\\\":{\\\"alert\\\": \\\"Check out these awesome deals!\\\",\\\"url\\\":\\\"www.amazon.com\\\"} }\",\n  \"GCM\":\"{\\\"data\\\":{\\\"message\\\":\\\"Check out these awesome deals!\\\",\\\"url\\\":\\\"www.amazon.com\\\"}}\"\n}\n```\n\nYou can read about Amazon SNS message formats [here](http://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-custommessage.html).\n\niOS:\n\n```js\n{\n  aps: {\n    alert: message\n  }\n}\n```\n\nRead more about APNS payload [here](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html).\n\nAndroid & Kindle Fire:\n\n```js\n{\n  data: {\n    message: message\n  }\n}\n```\n\nRead more about GCM [here](http://developer.android.com/google/gcm/c2dm.html) and ADM [here](http://docs.aws.amazon.com/sns/latest/dg/mobile-push-adm.html).\n\n#### broadcastMessage(message, callback)\nSend message to all users. May take some time with large sets of users as it has to page through users. Callback format is callback(err). If a single/mulitple messages fail to send the error will not be propogated/returned to the callback. To catch these errors use the _sendFailed_ event.\n\n\n## Contributors\nContrinbutions are very much welcome, just submit a PR with updated tests where \napplicable. Current tests run against the actual SNS service, which may not be \nideal so feel free to mock that out if you like too ;)\n\nThanks to these awesome folks for contributions:\n\n* [abiskop](https://github.com/abiskop)\n* [iclems](https://github.com/iclems)\n* [race](https://github.com/race)\n","maintainers":[{"name":"evanshortiss","email":"evanshortiss@gmail.com"}],"time":{"modified":"2022-06-26T21:46:10.134Z","created":"2013-12-20T16:00:30.391Z","0.0.0":"2013-12-20T16:00:32.793Z","0.0.2":"2014-03-14T21:13:40.156Z","0.0.3":"2014-04-26T14:44:23.958Z","1.0.0":"2014-09-22T02:46:28.084Z","1.0.1":"2014-09-26T14:17:26.390Z","1.0.2":"2014-09-30T16:03:14.260Z","1.1.0":"2015-02-05T22:42:10.915Z","1.2.0":"2015-06-24T20:38:43.751Z","1.3.0":"2015-08-14T01:07:23.592Z","1.3.1":"2021-07-12T10:04:48.325Z"},"author":{"name":"Evan Shortiss"},"keywords":["sns","amazon","aws","apns","gcm","kindle","fire","push","ios","android","notification","simple notification service"],"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/evanshortiss/sns-mobile#readme","repository":{"type":"git","url":"git+https://github.com/evanshortiss/sns-mobile.git"},"bugs":{"url":"https://github.com/evanshortiss/sns-mobile/issues"},"users":{"htavakoli":true,"labithiotis":true,"arnold-almeida":true,"mordhau":true,"jakub.knejzlik":true,"rkopylkov":true}}