Push Notification Registration for iOS

Overview

Orbiter

Note: This project is no longer being maintained.

For most iOS client / server applications, push notifications are negotiated through an intermediary service provider, such as Urban Airship. The service provider exposes APIs to register a device token, as well as APIs to send push notifications to devices meeting some specified criteria.

Orbiter is a small library that provides simple interfaces to register (and unregister) for Push Notifications with Urban Airship (without needing to include their SDK), as well as Helios apps.

Orbiter is named for the orbital space craft of the Space Shuttle program, which houses the flight crew and electronics used to communicate with mission control.

This project is part of a series of open source libraries covering the mission-critical aspects of an iOS app's infrastructure. Be sure to check out its sister projects: GroundControl, SkyLab, CargoBay, and houston.

Example Usage

Urban Airship Registration

- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
    [[UrbanAirshipOrbiter urbanAirshipManagerWithApplicationKey:@"..." applicationSecret:@"..."] registerDeviceToken:deviceToken withAlias:nil success:^(id responseObject) {
        NSLog(@"Registration Success: %@", responseObject);
    } failure:^(NSError *error) {
        NSLog(@"Registration Error: %@", error);
    }];
}

Helios Registration

- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
    NSURL *serverURL = [NSURL URLWithString:@"http://raging-notification-3556.herokuapp.com/"];
    Orbiter *orbiter = [[Orbiter alloc] initWithBaseURL:serverURL credential:nil];
    [orbiter registerDeviceToken:deviceToken withAlias:nil success:^(id responseObject) {
        NSLog(@"Registration Success: %@", responseObject);
    } failure:^(NSError *error) {
        NSLog(@"Registration Error: %@", error);
    }];
}

License

Orbiter is available under the MIT license. See the LICENSE file for more info.

Comments
  • UA Registration stop working

    UA Registration stop working

    hi @mattt, the Urban Airship Registration stop working with error:

    Registration Error: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldnโ€™t be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragments not set.) UserInfo=0x1d87a2c0 {NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}

    The same code worked two days ago. Have no idea whether the UA server side changes something.

    opened by smilingpoplar 9
  • changed To Use AFNetworking 2.0.x

    changed To Use AFNetworking 2.0.x

    AFNetworking 2.0 doesn't fly with Orbiter.

    My first commit to the pull just changed the version dependency to use 1.x. Then, I decided to just rewrite it for AFN 2.0 since I'm rolling with the 2.x version in my project.

    If you don't want to use my pull req to make it 2.x compatible, you should change up the podspec at a minimum because it defaults to the latest version of AFNetworking.

    opened by tayhalla 5
  • no use of the device token?

    no use of the device token?

    Hi,

    looking here, I am wondering about the use of the deviceToken: https://github.com/mattt/Orbiter/blob/master/Orbiter/Orbiter.m#L258-L262

    In the other two impls of the requestForRegistrationOfDeviceToken the actual token is used...

    opened by matzew 5
  • What is Orbiter all about?

    What is Orbiter all about?

    Hi,

    it is not entirely clear to me what Orbiter is Orbiter all about?

    • Is it because you want to (un)register for push notifications easier than it already is pretty easy (this is true at least for parse, I am not sure for UrbanAirship though)?
    • Is it because you want to (un)register for same user/device here 'n there all at once easier?
    • Huh?

    I am confused.

    Thanks mattt! ;-)

    opened by exalted 4
  • payload isn't uploaded to Helios

    payload isn't uploaded to Helios

    When appending a payload as parameters (I just use the example function with my Helios server specified), the parameters aren't appended to the NSURLRequest.

    opened by Leandros 3
  • Push Notifications endpoint

    Push Notifications endpoint

    I believe the endpoint for push notifications should be /push_notification/devices instead of /devices. This coincides with issue #57 from the helios-framework repo.

    opened by ghost 3
  • making default header application/json

    making default header application/json

    ...complaining about

    UrbanAirship was complaining about the content type, not being one of the following;

    • text/json
    • application/json
    • text/javascript

    it seems to be defaulting to text/plain which causes Urban Airship to throw an error causing the error block to always be executed, the device still does register though.

    2013-05-20 18:38:31.133 Neckbeard[9426:907] Registration Error: Error Domain=AFNetworkingErrorDomain Code=-1016 "Expected content type {(
        "text/json",
        "application/json",
        "text/javascript"
    )}, got text/plain" UserInfo=0x1fd52d80 {NSLocalizedRecoverySuggestion=OK, AFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest https://go.urbanairship.com/api/device_tokens/<token>>, NSErrorFailingURLKey=https://go.urbanairship.com/api/device_tokens/<token>, NSLocalizedDescription=Expected content type {(
        "text/json",
        "application/json",
        "text/javascript"
    )}, got text/plain, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x1fd0f700>}
    
    opened by myusuf3 3
  • Backports for 1.x

    Backports for 1.x

    This backports a handful of 2.x changes into 1.x for those of us unfortunate souls who can't bump up to 2.0 because we have to maintain onerous pre-iOS-6 compatibility. The most important of these changes is f191190, because without it projects will no longer build in Xcode 6 if they use Orbiter 1.x.

    opened by egrim 1
  • Getting compile errors about NSLocale not exposing a

    Getting compile errors about NSLocale not exposing a "identifier" method

    Orbiter.m line 103 retrieves a locale identifier like this:

    [mutablePayload setValue:[[NSLocale currentLocale] identifier] forKey:@"locale"];
    

    and xCode 6 complains that NSLocale doesn't declare any selector "identifier"

    Using localeIdentifier instead should solve that compile time error

    opened by rist 1
  • Non-existant property call

    Non-existant property call

    Xcode 6 update identified this call "identifier" as non existant on class "NSLocale" and forbids me to compile. I suspect that this call returns "nil" since for ever, or you are using without knowledge a private API.

    opened by Valpertui 1
  • use of deprecated requestWithMethod:URLString:parameters: from AFHTTPRequestSerializer

    use of deprecated requestWithMethod:URLString:parameters: from AFHTTPRequestSerializer

    Orbiter/Orbiter.m:86:48: warning: 'requestWithMethod:URLString:parameters:' is deprecated [-Wdeprecated-declarations] return [self.HTTPManager.requestSerializer requestWithMethod:@"PUT" URLString:urlString parameters:payload]; ^

    opened by paulz 1
Owner
Mattt
Mattt
OS X and iOS application and framework to play with the Apple Push Notification service (APNs)

Pusher OS X and iOS application and framework to play with the Apple Push Notification service (APNs) Installation Install the Mac app using Homebrew

noodlewerk 6.2k Dec 22, 2022
๐Ÿคจ Apple Push Notification service tutorial

APNsTutorial-iOS ?? Apple Push Notification service tutorial ๋‹จ์ˆœํžˆ ์ˆœ์„œ๋ฅผ ๋”ฐ๋ผ์„œ ๊ฐ€๋ฉด ๋  ์ค„ ์•Œ์•˜๋Š”๋ฐ ์•Œ์•„์•ผํ•  ๊ฒƒ๋„ ์žˆ์—ˆ๊ณ  ๊ฒฝ์šฐ์— ๋”ฐ๋ผ์„œ ์š”๊ตฌํ•˜๋Š” ํŒŒ์ผ๋„ ๋‹ฌ๋ž๋‹ค. ๊ทธ๋Ÿฌ๋‹ˆ ์ฒœ์ฒœํžˆ ์ฝ์–ด์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค. ๋จผ์ € ์–ด๋–ค ์„œ๋ฒ„ ํ™˜๊ฒฝ

Hyungyu Kim 11 Dec 28, 2022
How to Add Local Push Notification With timeInterval & Test On Simulator

Technicalisto How to Add Local Push Notification With timeInterval & Test On Simulator In Project Target ( Signing & Capapilities ) Add Capapility : 1

Aya Baghdadi 0 Jun 24, 2022
The debug application for Apple Push Notification Service (APNs).

Knuff The debug application for Apple Push Notification Service (APNs). Download the latest version Features Send push notifications to APNS (Apple Pu

Knuff 5.2k Dec 26, 2022
APNSUtil is makes code simple using apple push notification service

APNSUtil APNSUtil makes code simple settings and landing for apple push notification service. Features Using apple push notification service simply No

Steve Kim 30 Mar 24, 2022
A Swift Library for Dynamic Island Push Notification.

Push Notification With Dynamic Island Handle Push Notification with Dynamic Island ?? Descreption: Since there is not library for Apple Push Notificat

Amir Diafi 5 Nov 12, 2022
Push notifications allow developers to reach users, even when users aren't actively using an app!

Push notifications allow developers to reach users, even when users aren't actively using an app! With the latest update of iOS Apple provide very useful extensions which are user-friendly. In this tutorial, I am going to share the configuration, set up of Notification with the media attachments like.

MindInventory 16 Mar 3, 2022
Pushkin is a free open source tool for sending push notifications

Unmaintained This repository is no longer maintained. Pushkin Introduction Pushkin is a free open source tool for sending push notifications. It was d

Nordeus 257 Nov 3, 2022
SystemNotification is lets you mimic the native iOS system notification in your SwiftUI apps.

SystemNotification is a SwiftUI library that lets you mimic the native iOS system notification in your iOS apps.

Daniel Saidi 153 Dec 22, 2022
FNotify - Notification Library For iOS

FNotify Notification Library For IOS FNotify.mov Requirements: xcode 12+ swift 5

Frameworks 1 Jan 9, 2022
Add the 'Hide Notification Badges' Focus mode setting from iOS to macOS

FocusPlsNoBadges Add the 'Hide Notification Badges' Focus mode setting from iOS to macOS, in a really gross and hacky way. Getting started Build the X

Ayden Panhuyzen 18 Dec 14, 2022
Chanify is a safe and simple notification tools. This repository is iOS clinet for Chanify.

Chanify English | ็ฎ€ไฝ“ไธญๆ–‡ Chanify is a safe and simple notification tools. For developers, system administrators, and everyone can push notifications wit

Chanify 156 Jan 4, 2023
SNPnotificationBar - Notification Bar for ios

SNPnotificationBar Screenshot Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements S

Ahmad Almasri 7 Nov 20, 2019
Custom notification view

Custom notification view

Ivan Kopiev 2 Sep 15, 2022
Roar - Let's reskin Notification Center

Roar Let's reskin Notification Center. See this blog post. Thanks Big thanks to

Tyler Hall 8 Mar 15, 2022
ToDoAppCoreData - MVVM + Core Data + Local Notification

ToDo App Features MVVM + Core Data + Local Notification Screen recordings Creadi

Watery Desert 22 Nov 28, 2022
A fully customizable library to easily display Animated Toast Messages in iOS using Swift!

CustomToastView-swift A fully customizable library to easily display Animated Toast Messages in iOS using Swift! Preview - All the custom toasts you c

Leticia Rodriguez 13 Aug 20, 2022
Library to send mock remote notifications to the iOS simulator

SimulatorRemoteNotifications SimulatorRemoteNotifications is a library to send mock remote notifications to the iOS simulator. The library extends UIA

Arnaud Coomans 1.4k Dec 20, 2022
OS X app for sending push with Apple Push Notification service (APNs)

pushHandle OS X app for sending push with Apple Push Notification service (APNs) About This app was created just to allow painless testing of push not

hbk3 3 Nov 17, 2022
An example implementation of using a native iOS Notification Service Extension (to display images in remote push notification) in Titanium.

Titanium iOS Notification Service Extension An example implementation of using a native iOS Notification Service Extension (to display images in remot

Hans Knรถchel 8 Nov 21, 2022