Coder Social home page Coder Social logo

pushyexample's Introduction

Getting Started - iOS Setup

Step 1- Download the iOS API Sample app

<%= link_to 'Version 1.0', 'https://github.com/logansease/pushyExample' %>

Step 2- Extract and open the sample app

Step 3- Copy Dependant Libraries

Drag and drop the following folders from the sample app into your project

  • ASIHTTP

Step 4- Copy Pushy API Files

Drag and drop the files in the Pushy folder from the sample project.

Step 5- Link Required Frameworks

Add the following frameworks to your project

  • MobileCoreServices
  • CFNetwork
  • libz.dylib
  • SystemConfiguration

Step 6- Set your project up for Push Notifications

Go to the Apple iOS Provisioning Portal, configure your app for Push Notifications and download your push certificates.

Step 7- Convert your certificates

Go to the folder where you saved your certificates in step 6. Run the following commands on both the Development and the Production certificate. Ensure that you name them appropriately. In the commands below, replace aps_push_certificate_DEV with the names of the certificates you saved in step 6. The output file name 'outputName_DEV_cert' can be replaced with any name, just so you can remember which is development and which is production.


  $ openssl x509 -in aps_push_certificate_DEV.cer -inform der
      -out outputName_DEV_cert.pem

$ openssl pkcs12 -nocerts -out outputName_DEV_cert.pem -in outputName_DEV_cert.p12

Step 8- Set up Pushy API App

Register at pushyapi.com. Create a new app.

Copy and paste the contents of the dev/prod .pem files generated in step 7 into the dev / prod certificate fields.

In your project, open PushyNotificationService.h and add the app ID and secret Key for your app.

Step 9- Add Pushy Registration code to your AppDelegate


    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        ...
        NSLog(@"Registering for push notifications...");
        [[UIApplication sharedApplication]
            registerForRemoteNotificationTypes:
            (UIRemoteNotificationType)
            (UIRemoteNotificationTypeBadge |
            UIRemoteNotificationTypeSound |
            UIRemoteNotificationTypeAlert)];
    }
    - (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
        NSString *str = [NSString stringWithFormat:@"Device Token=%@",deviceToken];
        [[PushNotificationService sharedService] saveNewDevice:deviceToken];
    }
    

You're ready to go!

Getting Started - Use it

Log into PushyAPI.com

Select your App, and press 'Push Notifications'.

Here you can view how many devices have registered to receive push notifications from within your app.

Press on 'Send notification', and fill out a simple form with the Info you'd like in your Notification and press send.

That's it!

All users of your app that have registered will receive the push notification to their device. It's that easy!

pushyexample's People

Contributors

logansease avatar

Watchers

James Cloos avatar  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.