Skip to content

Simple NSString category to convert formatted APNS payload string into(loc-args, loc-key) a string

Notifications You must be signed in to change notification settings

aerialcombat/apstoNSString

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

apstoNSString

This is an adaptation of Matt Gallagher's solution to working with va_list.

http://www.cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html

I wrote this so I can grab the message from APNS payload.

You can use this in one of two ways.

userInfo is the info from (void)application:didReceiveRemoteNotification:

NSDictionary *aps = userInfo[@"aps"]; NSDictionary *alert = aps[@"alert"]; NSString *message = [NSString stringWithAlert:alert];

NSDictionary *aps = userInfo[@"aps"]; NSDictionary *alert = aps[@"alert"]; NSArray *localizablearguments = alert[@"loc-args"]; NSString *localizableKey = alert[@"loc-key"]; NSString *message = [NSString stringWithArguments:localizablearguments forKey:localizableKey];

About

Simple NSString category to convert formatted APNS payload string into(loc-args, loc-key) a string

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published