This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
android:versionCode="1" | |
android:versionName="1.0" package="com.urbanairship.push.sample"> | |
<!-- minSdkVersion sets runtime compatibility ("will run on API level 4") --> | |
<!-- targetSdkVersion should be set to the latest version tested, to disable compatibility modes | |
("was tested with API level 9 features") --> | |
<uses-sdk android:minSdkVersion="4" | |
android:targetSdkVersion="9"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2009-2011 Urban Airship Inc. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
2. Redistributions in binaryform must reproduce the above copyright notice, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2009-2011 Urban Airship Inc. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
2. Redistributions in binaryform must reproduce the above copyright notice, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copy and paste this method into your AppDelegate to recieve push | |
// notifications for your application while the app is running. | |
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { | |
UALOG(@"did receive remote notification: %@", userInfo); | |
[[UAirship shared].analytics handleNotification:userInfo]; | |
[newsstand handleNewsstandPushInfo:userInfo]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************************** | |
* In application:DidFinishLaunchingWithOptions: | |
************************************************/ | |
// Set up newsstand helper | |
// newsstand is an ivar - you will need to declare it in your header and | |
// release it in dealloc | |
newsstand = [[UANewsstandHelper alloc] init]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For debugging - allow multiple pushes per day | |
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NKDontThrottleNewsstandContentNotifications"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register for notifications | |
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeNewsstandContentAvailability | // Newsstand type <--- | |
UIRemoteNotificationTypeBadge | | |
UIRemoteNotificationTypeSound | | |
UIRemoteNotificationTypeAlert)]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To enable newsstand: | |
<key>UINewsstandApp</key> | |
<true/> | |
To enable background downloads: | |
<key>UIBackgroundModes</key> | |
<array> | |
<string>newsstand-content</string> |