GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ZeroPush/ZeroPush-iOS: the iOS lib for ZeroPush

BranchesTags
Open more actions menu

Latest commit

 

History

84 Commits
84 Commits

Folders and files

NameName
Last commit message
Last commit date
ZeroPush-iOS Tests
ZeroPush-iOS Tests
 
 
ZeroPush-iOS.xcodeproj
ZeroPush-iOS.xcodeproj
 
 
ZeroPush-iOS
ZeroPush-iOS
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CHANGES.md
CHANGES.md
 
 
LICENSE
LICENSE
 
 
Podfile
Podfile
 
 
Podfile.lock
Podfile.lock
 
 
README.md
README.md
 
 
ZeroPush.podspec
ZeroPush.podspec
 
 
zeropush-docs-header.png
zeropush-docs-header.png
 
 

Repository files navigation

ZeroPush ZeroPush Cocoapod ZeroPush Travis

Purpose:

ZeroPush-iOS is a lightweight Obj-C wrapper around the ZeroPush API. It provides some convenience methods to help you get up an running with ZeroPush as quickly as possible.

Building/Linking/Adding to your project:

We recommend using the ZeroPush Cocoapod.

In your Podfile add the following line:

pod 'ZeroPush', '~> 2.0'

and install the Pods

$> pod install

Configuration:

After the client library has been installed, add the following to your AppDelegate.

//In AppDelegate.h - Add the ZeroPushDelegate

#import "ZeroPush.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, ZeroPushDelegate>


// In AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

#if DEBUG
    [ZeroPush engageWithAPIKey:@"iosdev_apptoken" delegate:self];
#else
    [ZeroPush engageWithAPIKey:@"iosprod_apptoken" delegate:self];
#endif

    //now ask the user if they want to recieve push notifications. You can place this in another part of your app.
    [[ZeroPush shared] registerForRemoteNotifications];
    
    return true;
}

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)tokenData
{
    // Call the convenience method registerDeviceToken, this helps us track device tokens for you
    [[ZeroPush shared] registerDeviceToken:tokenData];

    // This would be a good time to save the token and associate it with a user that you want to notify later.
    NSString *tokenString = [ZeroPush deviceTokenFromData:tokenData];
    NSLog(@"%@", tokenString);

    // For instance you can associate it with a user's email address
    // [[ZeroPush shared] subscribeToChannel:@"[email protected]"];
    // You can then use the /broadcast endpoint to notify all devices subscribed to that email address. No need to save tokens!
    // Don't forget to unsubscribe from the channel when the user logs out of your app!
}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
    NSLog(@"%@", [error description]);
    //Common reason for errors:
    //  1.) Simulator does not support receiving push notifications
    //  2.) User rejected push alert
    //  3.) "no valid 'aps-environment' entitlement string found for application"
    //      This means your provisioning profile does not have Push Notifications configured. https://zeropush.com/documentation/generating_certificates
}

Upgrading from iOS7

If you were using the helper method [[ZeroPush shared] registerForRemoteNotificationTypes:] in iOS7, you will need to change it when deploying to iOS8

Before:

[[ZeroPush shared] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];

After:

[[ZeroPush shared] registerForRemoteNotifications];

Documentation:

For more detailed documentation, refer to the ZeroPush Docs.

License:

Copyright (c) 2015 Symmetric Infinity LLC

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.

About

the iOS lib for ZeroPush

zeropush.com/documentation/client_libraries

Resources

Readme
License
Activity
Custom properties

Stars

29 stars

Watchers

2 watching

Forks

18 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.