SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
Push Notification Service
Push Notifications

Message
Pop-Up

Increase User
Engagement
Latest
Updates

Calendar Events
Benefits of Push Notification
Increases user-engagement
e.g. In a turn-based game like Tic-Tac-Toe, it can notify a user of his turn (suppose
he gets a phone call in between and forgets that he was playing!!)
Allows to send messages to users even when the app is not running; thus helps in
reminding them of your App
Helps to build a fan community around your game by pushing to a targeted
audience – like your regular gamers
Allows an App to notify its users of new events without needing to actually open it,
i.e. by a sound or a screen pop up
App42 Push Notification supports

Coming Soon!!

&
Why App42 Push Notification?
Our Push Notification API can be used to send crossplatform push messages to devices running on iOS,
Android and Windows Phone with a single API call

No infrastructure & scalability worries
• Send Image/Text/URLs text-based Push Notifications
• Send messages in Channel Subscription Mode
• Send Scheduled Push as per Time-Zone
Push Analytics
• Analyze your Push Campaign with App42 Analytics
• Evaluate the number of Push messages sent, delivered
and opened.
Creating a channel & scheduling
Push messages through AppHQ
Push Analytics
A very useful feature that can track:


How many Push Notifications were sent from your side



How many were delivered, and



Push Notification Campaign

How many users opened the message

31%

100%

Sent
Delivered
Opened

These analytics can be viewed from our AppHQ console.

74%

Why Push Analytics?
When you use our Push Notification Service, each Push goes from the App42 server to
GCM/APNS/MPNS and then to the user device.
• Delivery of Push Notification is not guaranteed even from the service provider
• Once delivered, there might be a chance that user just clears it without opening the message

Thus, Analytics gives you a better insight of your Push Notification campaign.
Integrating with iOS
10 steps to PUSH
First create a certificate from iOS Dev Center. (Visit tutorial: http://app42.sh/12dpgQW)
Install the.cer file, which was downloaded in the above step.

Convert the iPhone developer certificate into a .p12 file:

•

Go to Applications/Utilities folder > Keychain Access application folder > Keys category

•

Select the private key associated with your iPhone Development Certificate (The private key is
identified by the iPhone Developer as: public certificate that is paired with it).

•

Select File > Export Items

•

Save your key in the (.p12) format.

•

You will be prompted to create a password which will be used when you will attempt to import this
key on another computer.
Contd..
Make your .p12 file compatible with App42 server:

•

Keep your .cer file and .p12 file in a single folder

•

Open terminal and go to the folder that has both the files.
shephertz-technologiess-iMac:~ shephertztechnologies$ cd "your folder path"

•

Now execute the following commands in the terminal:
1 openssl x509 -in developer_identity.cer -inform DER -out developer_identity.pem -outform PEM
2 openssl pkcs12 -nocerts -in yourPrivateKey.p12 -out yourPrivateKey.pem
3 openssl pkcs12 -export -inkey yourPrivateKey.pem -in developer_identity.pem -out iphone_dev.p12

Where,
- developer_identity.cer <= certificate you downloaded from Apple
- yourPrivateKey.p12
<= your private key
Contd..
Upload iphone_dev.p12 file to the AppHQ console:

Open your Xcode project and navigate to the
AppDelegate.m class and change the
application:didFinishLaunchingWithOptions: method
to look like this:
1 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
2 {
3
// Let the device know we want to receive push notifications
4
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
5
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
6

return YES;

7 }

The above code tells the OS that this App wants to receive push notifications.
Contd..
Add the following delegate methods in your AppDelegate.m in order to receive pushes:
1 - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
2 {
3
NSLog(@"My token is: %@", deviceToken);
4
5
// Prepare the Device Token for Registration (remove spaces and &lt;
&gt;)
6
NSString *devToken = [[[[deviceToken description]
7
8
9
10
11
12
13
14
15
16

stringByReplacingOccurrencesOfString:@"&lt;"withString:@""] stringBy

ReplacingOccurrencesOfString:@"&gt;" withString:@""]

stringByReplacingOccurrencesOfString: @" " withString: @""];
NSLog(@"My Device token is: %@", devToken);
}
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
NSLog(@"Failed to get token, error: %@", error);
}

When your App registers for remote (push) notifications, it tries to obtain a “device token”
(a 32-byte address of your device).
Contd..
Now register your device with the App42 Server. Change the delegate method
application:didRegisterForRemoteNotificationsWithDeviceToken: in the AppDelegate.m class to look like this:
1
2
3
4

- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{ NSLog(@"My token is: %@", deviceToken);
// Prepare the Device Token for Registration (remove spaces and &lt; &gt;)
NSString *devToken = [[[[deviceToken description]

5 stringByReplacingOccurrencesOfString:@"&lt;"withString:@""] stringByReplacingOccurrencesOfString:@"&gt;" withString:@""]
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

stringByReplacingOccurrencesOfString: @" " withString: @""];
NSLog(@"My Device token is: %@", devToken);
/** * Register the device token for App42 Push notification services */
[self registerUserForPushNotificationToApp42Cloud:devToken];
}
-(void)registerUserForPushNotificationToApp42Cloud:(NSString*)deviceToken
{ ServiceAPI *serviceObj = [[ServiceAPI alloc]init];
serviceObj.apiKey = APP42_APP_KEY;
serviceObj.secretKey = APP42_SECRET_KEY;
PushNotificationService *pushObj = [serviceObj buildPushService];
@try
{ PushNotification *pushNotification =[pushObj registerDeviceToken:deviceToken withUser:@"User Name"];
[pushNotification release]; }
@catch (App42Exception *exception)
{ NSLog(@"%@",exception.reason); }
@finally
{ [serviceObj release];
[pushObj release]; }
}
Contd..
Now to send a Push Notification, call the following method in a commonly used class in your
project so that you can call this whenever you want to:
1
2
3
4
5
6
7
8
9
10
11

-(void)sendPush:(NSString*)message
{
ServiceAPI *serviceObj = [[ServiceAPI alloc]init];
serviceObj.apiKey = APP42_APP_KEY;
serviceObj.secretKey = APP42_SECRET_KEY;
PushNotificationService *pushObj = [serviceObj buildPushService];
@try
{ NSMutableDictionary *pushDictionary = [NSMutableDictionary dictionary];
[pushDictionary setObject:message forKey:@"alert"];
[pushDictionary setObject:@"default" forKey:@"sound"];
[pushDictionary setObject:@"1" forKey:@"badge"];

12 PushNotification *pushNotification = [pushObj sendPushMessageToUser:@"User Name" withMessageDictionary: pushDictionary];
13
14
15
16
17
18
19

[pushNotification release]; }
@catch (App42Exception *exception)
{ NSLog(@"%@",exception.reason); }
@finally
{ [serviceObj release];
[pushObj release]; }
}
Contd..
The pushDictionary in the above code should always follow the same structure as mentioned
above to deliver the push notification successfully using App42 Server.

•

You can remove or add the items to the pushDictionary if needed as per the Apple guidelines.

•

If you want to take any actions when you receive push notification then you need to add the
following delegate method in the AppDelegate.m class:

1 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
2 {
3 NSLog(@"%s..userInfo=%@",__FUNCTION__,userInfo);

4 /** * Dump your code here according to your requirement after receiving push */
5 }

•

With the above mentioned step, your App has been successfully set up to receive/send Push
Notifications through our App42 Server using App42 Push Notification Service.
IT IS THAT SIMPLE!!!
Some useful links
Getting Started:

Downloads:

Quick Start Guide

App42 Cloud SDKs

Sign-up for Free

App 42 Modules

Game Development Center

Blogs:
Concepts:

Why BaaS?

Backend as a Service

Push Notification for iOS

Massive Multiplayer Gaming Engine

Push Notification for Android

App Analytics

Real-time Multiplayer Games using Unity3D
Integrating Facebook in your Android App

Products:

Making a Turn-based Game

App42 Cloud APIs - BaaS

Using Query Interface

AppWarp – Multiplayer Gaming Engine

When to use NoSQL?

AppHQ – Management Console

Add ‘Social’ to your Game

AppHawk – Project Management Tool
AppClay – Custom App Builder
Links for Reference :
http://www.shephertz.com
http://api.shephertz.com
http://appwarp.shephertz.com
http://app42paas.shephertz.com

Contact: sales@shephertz.com
Skype: ShepHertz

Follow us on:

Mais conteúdo relacionado

Mais de ShepHertz

Complete steps to Integrate Push Notification for Your Cocos2dx App with Push...
Complete steps to Integrate Push Notification for Your Cocos2dx App with Push...Complete steps to Integrate Push Notification for Your Cocos2dx App with Push...
Complete steps to Integrate Push Notification for Your Cocos2dx App with Push...ShepHertz
 
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dx
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dxA Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dx
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dxShepHertz
 
Media &amp; entertainment marketing automation and omnichannel media
Media &amp; entertainment marketing automation and omnichannel mediaMedia &amp; entertainment marketing automation and omnichannel media
Media &amp; entertainment marketing automation and omnichannel mediaShepHertz
 
Insurance marketing automation and omni channel insurance.
Insurance marketing automation and omni channel insurance.Insurance marketing automation and omni channel insurance.
Insurance marketing automation and omni channel insurance.ShepHertz
 
Travel and aviation marketing automation and omnichannel travel
Travel and aviation marketing automation and omnichannel travelTravel and aviation marketing automation and omnichannel travel
Travel and aviation marketing automation and omnichannel travelShepHertz
 
Gaming marketing automation and multiplayer game development
Gaming marketing automation and multiplayer game developmentGaming marketing automation and multiplayer game development
Gaming marketing automation and multiplayer game developmentShepHertz
 
Retail marketing automation and omni channel retail experience.
Retail marketing automation and omni channel retail experience.Retail marketing automation and omni channel retail experience.
Retail marketing automation and omni channel retail experience.ShepHertz
 
Banking Services Marketing Automation and Omni-channel Banking
Banking Services Marketing Automation and Omni-channel BankingBanking Services Marketing Automation and Omni-channel Banking
Banking Services Marketing Automation and Omni-channel BankingShepHertz
 
ShepHertz Cloud Ecosystem for Apps
ShepHertz Cloud Ecosystem for AppsShepHertz Cloud Ecosystem for Apps
ShepHertz Cloud Ecosystem for AppsShepHertz
 
Push Notification with Unity in iOS using App42 Backend
Push Notification with Unity in iOS using App42 BackendPush Notification with Unity in iOS using App42 Backend
Push Notification with Unity in iOS using App42 BackendShepHertz
 
ShepHertz - アプリのための万全なエコシステム
ShepHertz - アプリのための万全なエコシステムShepHertz - アプリのための万全なエコシステム
ShepHertz - アプリのための万全なエコシステムShepHertz
 
Configuring MongoDB HA Replica Set on AWS EC2
Configuring MongoDB HA Replica Set on AWS EC2Configuring MongoDB HA Replica Set on AWS EC2
Configuring MongoDB HA Replica Set on AWS EC2ShepHertz
 
App42 Student Lab - Android Game Dev Series V 0.1
App42 Student Lab - Android Game Dev Series V 0.1App42 Student Lab - Android Game Dev Series V 0.1
App42 Student Lab - Android Game Dev Series V 0.1ShepHertz
 
ShepHertz - A Complete Cloud Ecosystem for your Apps
ShepHertz - A Complete Cloud Ecosystem for your AppsShepHertz - A Complete Cloud Ecosystem for your Apps
ShepHertz - A Complete Cloud Ecosystem for your AppsShepHertz
 

Mais de ShepHertz (14)

Complete steps to Integrate Push Notification for Your Cocos2dx App with Push...
Complete steps to Integrate Push Notification for Your Cocos2dx App with Push...Complete steps to Integrate Push Notification for Your Cocos2dx App with Push...
Complete steps to Integrate Push Notification for Your Cocos2dx App with Push...
 
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dx
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dxA Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dx
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dx
 
Media &amp; entertainment marketing automation and omnichannel media
Media &amp; entertainment marketing automation and omnichannel mediaMedia &amp; entertainment marketing automation and omnichannel media
Media &amp; entertainment marketing automation and omnichannel media
 
Insurance marketing automation and omni channel insurance.
Insurance marketing automation and omni channel insurance.Insurance marketing automation and omni channel insurance.
Insurance marketing automation and omni channel insurance.
 
Travel and aviation marketing automation and omnichannel travel
Travel and aviation marketing automation and omnichannel travelTravel and aviation marketing automation and omnichannel travel
Travel and aviation marketing automation and omnichannel travel
 
Gaming marketing automation and multiplayer game development
Gaming marketing automation and multiplayer game developmentGaming marketing automation and multiplayer game development
Gaming marketing automation and multiplayer game development
 
Retail marketing automation and omni channel retail experience.
Retail marketing automation and omni channel retail experience.Retail marketing automation and omni channel retail experience.
Retail marketing automation and omni channel retail experience.
 
Banking Services Marketing Automation and Omni-channel Banking
Banking Services Marketing Automation and Omni-channel BankingBanking Services Marketing Automation and Omni-channel Banking
Banking Services Marketing Automation and Omni-channel Banking
 
ShepHertz Cloud Ecosystem for Apps
ShepHertz Cloud Ecosystem for AppsShepHertz Cloud Ecosystem for Apps
ShepHertz Cloud Ecosystem for Apps
 
Push Notification with Unity in iOS using App42 Backend
Push Notification with Unity in iOS using App42 BackendPush Notification with Unity in iOS using App42 Backend
Push Notification with Unity in iOS using App42 Backend
 
ShepHertz - アプリのための万全なエコシステム
ShepHertz - アプリのための万全なエコシステムShepHertz - アプリのための万全なエコシステム
ShepHertz - アプリのための万全なエコシステム
 
Configuring MongoDB HA Replica Set on AWS EC2
Configuring MongoDB HA Replica Set on AWS EC2Configuring MongoDB HA Replica Set on AWS EC2
Configuring MongoDB HA Replica Set on AWS EC2
 
App42 Student Lab - Android Game Dev Series V 0.1
App42 Student Lab - Android Game Dev Series V 0.1App42 Student Lab - Android Game Dev Series V 0.1
App42 Student Lab - Android Game Dev Series V 0.1
 
ShepHertz - A Complete Cloud Ecosystem for your Apps
ShepHertz - A Complete Cloud Ecosystem for your AppsShepHertz - A Complete Cloud Ecosystem for your Apps
ShepHertz - A Complete Cloud Ecosystem for your Apps
 

Último

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Último (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

iOS Push Notification using App42 Mobile Backend as a Service

  • 3. Benefits of Push Notification Increases user-engagement e.g. In a turn-based game like Tic-Tac-Toe, it can notify a user of his turn (suppose he gets a phone call in between and forgets that he was playing!!) Allows to send messages to users even when the app is not running; thus helps in reminding them of your App Helps to build a fan community around your game by pushing to a targeted audience – like your regular gamers Allows an App to notify its users of new events without needing to actually open it, i.e. by a sound or a screen pop up
  • 4. App42 Push Notification supports Coming Soon!! &
  • 5. Why App42 Push Notification? Our Push Notification API can be used to send crossplatform push messages to devices running on iOS, Android and Windows Phone with a single API call No infrastructure & scalability worries • Send Image/Text/URLs text-based Push Notifications • Send messages in Channel Subscription Mode • Send Scheduled Push as per Time-Zone Push Analytics • Analyze your Push Campaign with App42 Analytics • Evaluate the number of Push messages sent, delivered and opened.
  • 6. Creating a channel & scheduling Push messages through AppHQ
  • 7. Push Analytics A very useful feature that can track:  How many Push Notifications were sent from your side  How many were delivered, and  Push Notification Campaign How many users opened the message 31% 100% Sent Delivered Opened These analytics can be viewed from our AppHQ console. 74% Why Push Analytics? When you use our Push Notification Service, each Push goes from the App42 server to GCM/APNS/MPNS and then to the user device. • Delivery of Push Notification is not guaranteed even from the service provider • Once delivered, there might be a chance that user just clears it without opening the message Thus, Analytics gives you a better insight of your Push Notification campaign.
  • 9. 10 steps to PUSH First create a certificate from iOS Dev Center. (Visit tutorial: http://app42.sh/12dpgQW) Install the.cer file, which was downloaded in the above step. Convert the iPhone developer certificate into a .p12 file: • Go to Applications/Utilities folder > Keychain Access application folder > Keys category • Select the private key associated with your iPhone Development Certificate (The private key is identified by the iPhone Developer as: public certificate that is paired with it). • Select File > Export Items • Save your key in the (.p12) format. • You will be prompted to create a password which will be used when you will attempt to import this key on another computer.
  • 10. Contd.. Make your .p12 file compatible with App42 server: • Keep your .cer file and .p12 file in a single folder • Open terminal and go to the folder that has both the files. shephertz-technologiess-iMac:~ shephertztechnologies$ cd "your folder path" • Now execute the following commands in the terminal: 1 openssl x509 -in developer_identity.cer -inform DER -out developer_identity.pem -outform PEM 2 openssl pkcs12 -nocerts -in yourPrivateKey.p12 -out yourPrivateKey.pem 3 openssl pkcs12 -export -inkey yourPrivateKey.pem -in developer_identity.pem -out iphone_dev.p12 Where, - developer_identity.cer <= certificate you downloaded from Apple - yourPrivateKey.p12 <= your private key
  • 11. Contd.. Upload iphone_dev.p12 file to the AppHQ console: Open your Xcode project and navigate to the AppDelegate.m class and change the application:didFinishLaunchingWithOptions: method to look like this: 1 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 2 { 3 // Let the device know we want to receive push notifications 4 [[UIApplication sharedApplication] registerForRemoteNotificationTypes: 5 (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; 6 return YES; 7 } The above code tells the OS that this App wants to receive push notifications.
  • 12. Contd.. Add the following delegate methods in your AppDelegate.m in order to receive pushes: 1 - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken 2 { 3 NSLog(@"My token is: %@", deviceToken); 4 5 // Prepare the Device Token for Registration (remove spaces and &lt; &gt;) 6 NSString *devToken = [[[[deviceToken description] 7 8 9 10 11 12 13 14 15 16 stringByReplacingOccurrencesOfString:@"&lt;"withString:@""] stringBy ReplacingOccurrencesOfString:@"&gt;" withString:@""] stringByReplacingOccurrencesOfString: @" " withString: @""]; NSLog(@"My Device token is: %@", devToken); } - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error { NSLog(@"Failed to get token, error: %@", error); } When your App registers for remote (push) notifications, it tries to obtain a “device token” (a 32-byte address of your device).
  • 13. Contd.. Now register your device with the App42 Server. Change the delegate method application:didRegisterForRemoteNotificationsWithDeviceToken: in the AppDelegate.m class to look like this: 1 2 3 4 - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { NSLog(@"My token is: %@", deviceToken); // Prepare the Device Token for Registration (remove spaces and &lt; &gt;) NSString *devToken = [[[[deviceToken description] 5 stringByReplacingOccurrencesOfString:@"&lt;"withString:@""] stringByReplacingOccurrencesOfString:@"&gt;" withString:@""] 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 stringByReplacingOccurrencesOfString: @" " withString: @""]; NSLog(@"My Device token is: %@", devToken); /** * Register the device token for App42 Push notification services */ [self registerUserForPushNotificationToApp42Cloud:devToken]; } -(void)registerUserForPushNotificationToApp42Cloud:(NSString*)deviceToken { ServiceAPI *serviceObj = [[ServiceAPI alloc]init]; serviceObj.apiKey = APP42_APP_KEY; serviceObj.secretKey = APP42_SECRET_KEY; PushNotificationService *pushObj = [serviceObj buildPushService]; @try { PushNotification *pushNotification =[pushObj registerDeviceToken:deviceToken withUser:@"User Name"]; [pushNotification release]; } @catch (App42Exception *exception) { NSLog(@"%@",exception.reason); } @finally { [serviceObj release]; [pushObj release]; } }
  • 14. Contd.. Now to send a Push Notification, call the following method in a commonly used class in your project so that you can call this whenever you want to: 1 2 3 4 5 6 7 8 9 10 11 -(void)sendPush:(NSString*)message { ServiceAPI *serviceObj = [[ServiceAPI alloc]init]; serviceObj.apiKey = APP42_APP_KEY; serviceObj.secretKey = APP42_SECRET_KEY; PushNotificationService *pushObj = [serviceObj buildPushService]; @try { NSMutableDictionary *pushDictionary = [NSMutableDictionary dictionary]; [pushDictionary setObject:message forKey:@"alert"]; [pushDictionary setObject:@"default" forKey:@"sound"]; [pushDictionary setObject:@"1" forKey:@"badge"]; 12 PushNotification *pushNotification = [pushObj sendPushMessageToUser:@"User Name" withMessageDictionary: pushDictionary]; 13 14 15 16 17 18 19 [pushNotification release]; } @catch (App42Exception *exception) { NSLog(@"%@",exception.reason); } @finally { [serviceObj release]; [pushObj release]; } }
  • 15. Contd.. The pushDictionary in the above code should always follow the same structure as mentioned above to deliver the push notification successfully using App42 Server. • You can remove or add the items to the pushDictionary if needed as per the Apple guidelines. • If you want to take any actions when you receive push notification then you need to add the following delegate method in the AppDelegate.m class: 1 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo 2 { 3 NSLog(@"%s..userInfo=%@",__FUNCTION__,userInfo); 4 /** * Dump your code here according to your requirement after receiving push */ 5 } • With the above mentioned step, your App has been successfully set up to receive/send Push Notifications through our App42 Server using App42 Push Notification Service.
  • 16. IT IS THAT SIMPLE!!!
  • 17. Some useful links Getting Started: Downloads: Quick Start Guide App42 Cloud SDKs Sign-up for Free App 42 Modules Game Development Center Blogs: Concepts: Why BaaS? Backend as a Service Push Notification for iOS Massive Multiplayer Gaming Engine Push Notification for Android App Analytics Real-time Multiplayer Games using Unity3D Integrating Facebook in your Android App Products: Making a Turn-based Game App42 Cloud APIs - BaaS Using Query Interface AppWarp – Multiplayer Gaming Engine When to use NoSQL? AppHQ – Management Console Add ‘Social’ to your Game AppHawk – Project Management Tool AppClay – Custom App Builder
  • 18. Links for Reference : http://www.shephertz.com http://api.shephertz.com http://appwarp.shephertz.com http://app42paas.shephertz.com Contact: sales@shephertz.com Skype: ShepHertz Follow us on: