Giter VIP home page Giter VIP logo

notifications-quickstart-objc's Introduction

notifications-quickstart-objc

Twilio Notifications starter iOS application in ObjC

This application should give you a ready-made starting point for writing your own notification-integrated apps with Twilio Notifications. Before we begin, you need to collected the credentials to run the notifications web app.

Credential Description
Twilio Account SID Your main Twilio account identifier - find it on your dashboard.
Twilio Credential SID Adds notification ability to your app - generate one here. You'll need to provision your APN push credentials to generate this. See this guide on how to do that.
Twilio Notification URL The base URL for the Notifications API -- https://notification.twilio.com
Twilio Notification_Service SID Use the create_service.js script to generate this. Just run 'node create_service.js' in your terminal.

You can download the Node notifications web app from here. ##Setting up the web app Edit config.json with the four configuration parameters we gathered from above.

Next, we need to install our dependencies from npm:

npm install

Now we should be all set! Run the application using the npm command.

npm start

Your application should now be running at http://localhost:3000.

##Please Note You'll need to test this on the device, since the iOS simulator can't receive notifications. To test on device, your server will need to be on the public Internet. For this, you might consider using a solution like ngrok.

Setting Up The iOS App

After downloading or cloning the app, in a terminal window enter the following

'pod install'

This will install the necessary dependency (AFNetworking). Once it's installed you can go ahead and open 'notification.xcworkspace'.

In the ViewController file, on this line,

static NSString * serverURL = @"http://YOUR_WEB_APP/register";

Replace the URL with the address of your server. The app uses 4 credentials to register your device for notifications.

Credential Description
Identity This is how the web app identifies an individual user as the receiver of notifications.
Endpoint This is a unique device ID and identity combination that can receive a message. (i.e Alice on her iPad is a different notification destination than Alice on her iPhone).
Bindingtype This lets the web app know which service to register with (APNS or GCM).
Address This is the unique device identifier of the mobile client.

Once you've entered your URL, you can compile & run the app. Enter in an identity in the text field that's presented. Once you tap register, the app will register your device with APNS and return a JSON response object if successful. After that, run the notify.js script in the web app repo

node notify.js YOUR_IDENTITY

To receive a notification in your app.

That's it!

License

MIT

notifications-quickstart-objc's People

Contributors

jefflinwood avatar llsourcell avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.