SlideShare a Scribd company logo
ADF Mobile : Push Notifications 
DOAG ADF Spotlight Webinar, June 6th 2014
Who Am I 
• Luc Bors 
• Principal Consultant 
• AMIS, Netherlands
Agenda 
• ADF Mobile Overview Architecture 
• Push Notifications Overview 
• Push Notifications Cloud Messaging Part 
• Push Notifications Provider Part 
• Push Notifications ADF Mobile Part
Push Notifications
Push Notifications 
•
Example 
• Select device 
• Send message • Get notified
Push Notifications 
• Subscribe to Messaging Service 
• Receive token 
• Register with Enterprise app 
• Enterprise app Pushes message 
to Messaging Service 
• Messaging Service delegates 
message to device(s)
Push Notification
Setup GCM 
• Google Cloud Project 
• Google Cloud Messaging API is 
enabled 
• API key
Setup APNS 
• iOS Developer account 
• App Id and Provisioning profile 
– Make sure to check the Push Notification Service when you create the new App Id 
• SSL Certificate
Create a Provider Application
Prepare Provider Application 
• Add gcm-server.jar (for GCMS) 
• Add javaPNS.jar (for APNS)
Code Behind the Button 
• Class to push a message to a device. 
public void pushNow(ActionEvent actionEvent) { 
….. Logic to get selected row… 
String target = (String)curr.getAttribute("DeviceToken"); 
String type = (String)curr.getAttribute("DeviceType"); 
if (type.equalsIgnoreCase("Android")) { 
pushMsgAmdroid(target, this.message); 
} else { 
pushMsgIos(target, this.message); 
}
Server Side for Android 
• Sending the message 
String sound = "default"; 
Message message = 
new Message.Builder() 
.delayWhileIdle(true) 
.addData("alert", msg) 
.addData("sound",sound) 
.addData("FeatureName", "Sessions") 
.addData("SessionId", "12") 
.build(); 
Result result; 
try { 
result = sender.sendNoRetry(message, regId); 
}
Server Side for iOS 
• Sending the message 
/* Build a blank payload to customize */ 
PushNotificationPayload payload = PushNotificationPayload.complex(); 
/* Custom the payload */ 
payload.addAlert(msg); 
payload.addBadge(1); 
payload.addCustomDictionary("FeatureName", "Sessions"); 
payload.addCustomDictionary("SessionId", "12"); 
Push.payload(payload, KEYSTORE_LOCATION, KEYSTORE_PASSWORD, false, 
target);
Preparing ADF Mobile 
• Register Application Life Cycle Listener 
• LifeCycleListener must implement 
oracle.adfmf.application.PushNotificationConfig interface. 
– This interface provides the registration configuration for push notifications
ApplicationLifeCycleListener 
• ApplicationLifeCycleListener 
– In the Start() Method create a new PushNotificationListener() 
public void start() { 
// Add code here... 
EventSource evtSource = 
EventSourceFactory.getEventSource( 
NativePushNotificationEventSource. 
NATIVE_PUSH_NOTIFICATION_REMOTE_EVENT_SOURCE_NAME); 
evtSource.addListener(new PushNotificationListener()); 
}
The PushNotificationListener 
• In the PushNotificationListener 
– OnOpen() // receive token 
– OnMessage() // handle notification 
– OnError() 
public void onOpen(String token) { 
// Invoked during the Push Notification registration process. 
// The parameter "token" contains the token received from APNs or GCMs 
// that uniquely identifies a specific device-application combination. 
ValueExpression ve = AdfmfJavaUtilities.getValueExpression( 
"#{applicationScope.deviceToken}", String.class); 
if (token != null){ 
ve.setValue(AdfmfJavaUtilities.getAdfELContext(), token); 
} 
else{ 
ve.setValue(AdfmfJavaUtilities.getAdfELContext(), "dummy Token"); 
} 
}
Token Registration 
• Use a webservice to send the Token to the provider Application 
• Provider stores token and uses it when sending notifications (remember 
the “code behind the button” 
public void pushNow(ActionEvent actionEvent) { 
….. Logic to get selected row… 
String target = (String)curr.getAttribute("DeviceToken"); 
String type = (String)curr.getAttribute("DeviceType"); 
if (type.equalsIgnoreCase("Android")) { 
pushMsgAmdroid(target, this.message); 
} else { 
pushMsgIos(target, this.message); 
}
All is there. 
• Cloud Services are setup 
• Provider app is created 
• Device Token can be sent to and stored at provider app 
• LETS PUSH ! And work with the notification
Push Notifications 
•
onMessage() 
Working with the Notification 
public void onMessage(Event event) { 
AdfELContext adfELContext = AdfmfJavaUtilities.getAdfELContext(); 
JSONBeanSerializationHelper jsonHelper = 
new JSONBeanSerializationHelper(); 
try {PayloadServiceResponse serviceResponse = 
(PayloadServiceResponse)jsonHelper.fromJSON( 
PayloadServiceResponse.class, event.getPayload()); 
ValueExpression notificationPayloadBinding = 
AdfmfJavaUtilities.getValueExpression( 
"#{applicationScope.notificationSessionId}", String.class); 
notificationPayloadBinding.setValue( 
AdfmfJavaUtilities.getAdfELContext() 
, serviceResponse.getSessionId()); 
AdfmfContainerUtilities.gotoFeature( 
"com.tamcapp.mobilebook.ses.ConferenceSessions"); 
}
Badging 
// also, lets decrease the application icon badge by one 
int currentBadge = 
AdfmfContainerUtilities.getApplicationIconBadgeNumber(); 
if (currentBadge > 0) { 
AdfmfContainerUtilities.setApplicationIconBadgeNumber( 
currentBadge - 1); 
}
In the feature… 
• Use FeatureLifeCycleListener 
– Activate() Method 
public void activate() { 
Boolean notified = 
(Boolean)AdfmfJavaUtilities.evaluateELExpression( 
"#{applicationScope.notified}"); 
if(notified.booleanValue({ 
AdfmfContainerUtilities.invokeContainerJavaScriptFunction( 
AdfmfJavaUtilities.getFeatureName(), 
"adf.mf.api.amx.doNavigation”, 
new Object[] { "featureActivated" });} 
}
DEMO
Push Notification - Summary 
• Configuration can be complicated (Especially on iOS) 
• Listeners, Listeners, Listeners 
– ApplicationLifeCycle 
– PushNotification 
– FeatureLifeCycle 
• Send Notification (optional with Payload) 
• onMessage() 
– Get Payload 
– Call feature 
• In Feature 
– Work with payload
Luc Bors, AMIS, The Netherlands 
Luc.Bors@amis.nl 
LucBors@gmail.com 
Follow me on : @lucb_

More Related Content

PDF
Oracle MAF real life OOW.pptx
PDF
ADF Mobile: 10 Things you don't get from the developers guide
PDF
amis-adf-enterprise-mobility
PDF
Real Life MAF (2.2) Oracle Open World 2015
PDF
Parse: A Mobile Backend as a Service (MBaaS)
PDF
Windows phone 7 series
PDF
Medium TechTalk — iOS
PDF
6 Things You Didn't Know About Firebase Auth
Oracle MAF real life OOW.pptx
ADF Mobile: 10 Things you don't get from the developers guide
amis-adf-enterprise-mobility
Real Life MAF (2.2) Oracle Open World 2015
Parse: A Mobile Backend as a Service (MBaaS)
Windows phone 7 series
Medium TechTalk — iOS
6 Things You Didn't Know About Firebase Auth

What's hot (18)

PDF
Rapid Application Development with SwiftUI and Firebase
PDF
Lecture 11. Microsoft mobile services
PDF
Supercharge Your Pages - New Ways to Extend the Confluence Editor
PDF
Build Amazing Add-ons for Atlassian JIRA and Confluence
PPTX
Creating a Custom PowerApp Connector using Azure Functions
PDF
MVS: An angular MVC
PDF
Making connected apps with BaaS (Droidcon Bangalore 2014)
PDF
How To Manage API Request with AXIOS on a React Native App
PDF
How to disassemble one monster app into an ecosystem of 30
PDF
Python Ireland Nov 2009 Talk - Appengine
PDF
Updates on the Data Center Apps Program
PDF
Rails Best Practices
PDF
Integrate CI/CD Pipelines with Jira Software Cloud
PDF
 +  = ❤️ (Firebase for Apple Developers) at Swift Leeds
PPTX
React native introduction
PPTX
Cloudformation101
PDF
Lecture 11 Firebase overview
PDF
Distributing information on iOS
Rapid Application Development with SwiftUI and Firebase
Lecture 11. Microsoft mobile services
Supercharge Your Pages - New Ways to Extend the Confluence Editor
Build Amazing Add-ons for Atlassian JIRA and Confluence
Creating a Custom PowerApp Connector using Azure Functions
MVS: An angular MVC
Making connected apps with BaaS (Droidcon Bangalore 2014)
How To Manage API Request with AXIOS on a React Native App
How to disassemble one monster app into an ecosystem of 30
Python Ireland Nov 2009 Talk - Appengine
Updates on the Data Center Apps Program
Rails Best Practices
Integrate CI/CD Pipelines with Jira Software Cloud
 +  = ❤️ (Firebase for Apple Developers) at Swift Leeds
React native introduction
Cloudformation101
Lecture 11 Firebase overview
Distributing information on iOS
Ad

Viewers also liked (16)

PDF
Push to Me: Mobile Push Notifications (Zend Framework)
PDF
Doag wysiwyg
PDF
ADF Essentials (KScope14)
PPTX
ΑΡΧΕΣ ΣΧΕΔΙΑΣΜΟΥ ΕΚΠΑΙΔΕΥΤΙΚΟΥ ΥΛΙΚΟΥ
PDF
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
PDF
Real life forms to adf
PDF
Oracle ADF Mobile OGh (Oracle User Group Netherlands)
PPTX
How to Bring Common UI Patterns to ADF
PPS
Profesiones
PPTX
Ppt pk
PPTX
Real life-maf-2015
PDF
In the hunt of 100% delivery rate with mobile push notifications
PDF
Visio-REPS_Referral_Workflow
PPTX
10 Shifts Changing Consumer Behavior / Germany
PPTX
Gearing up for mobile push notifications
PDF
Front series A deck
Push to Me: Mobile Push Notifications (Zend Framework)
Doag wysiwyg
ADF Essentials (KScope14)
ΑΡΧΕΣ ΣΧΕΔΙΑΣΜΟΥ ΕΚΠΑΙΔΕΥΤΙΚΟΥ ΥΛΙΚΟΥ
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
Real life forms to adf
Oracle ADF Mobile OGh (Oracle User Group Netherlands)
How to Bring Common UI Patterns to ADF
Profesiones
Ppt pk
Real life-maf-2015
In the hunt of 100% delivery rate with mobile push notifications
Visio-REPS_Referral_Workflow
10 Shifts Changing Consumer Behavior / Germany
Gearing up for mobile push notifications
Front series A deck
Ad

Similar to MAF push notifications (20)

PDF
Lime - Push notifications. The big way.
PDF
Petr Dvořák: Push notifikace ve velkém
PDF
Mobile Push Notifications
PPT
Apple push notification service
PDF
Leveraging Zend Framework for Sending Push Notifications
PDF
Zend Framework Push Notifications
PPTX
Delivering Millions of Push Notifications in Minutes
PPTX
Push Notification
PDF
How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps
PPTX
Azure notification hubs
PPTX
Push notifications
PPTX
IBM Mobile foundation overview
PDF
Creating a Facebook Clone - Part XLV - Transcript.pdf
PPT
Push Notification in IBM MobileFirst Xamarin SDK
PPTX
Make Good Apps great - Using IBM MobileFirst Foundation
PDF
Get step-by-step instructions on implementing notifications in your apps.
PPTX
Implementation of Push Notification in React Native Android app using Firebas...
PPTX
Push notifications
PDF
Push Notification with Unity in iOS using App42 Backend
PPTX
Apple notification push
Lime - Push notifications. The big way.
Petr Dvořák: Push notifikace ve velkém
Mobile Push Notifications
Apple push notification service
Leveraging Zend Framework for Sending Push Notifications
Zend Framework Push Notifications
Delivering Millions of Push Notifications in Minutes
Push Notification
How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps
Azure notification hubs
Push notifications
IBM Mobile foundation overview
Creating a Facebook Clone - Part XLV - Transcript.pdf
Push Notification in IBM MobileFirst Xamarin SDK
Make Good Apps great - Using IBM MobileFirst Foundation
Get step-by-step instructions on implementing notifications in your apps.
Implementation of Push Notification in React Native Android app using Firebas...
Push notifications
Push Notification with Unity in iOS using App42 Backend
Apple notification push

More from Luc Bors (17)

PDF
Talk to me Goose: Going beyond your regular Chatbot
PDF
Extending Oracle SaaS Using Oracle Cloud UX Rapid Development Kit
PDF
NO CODE : Or How to Extend Oracle SaaS with Oracle Visual Builder Cloud Service
PDF
Real life-maf-2015-k scope-final
PDF
Reaching out from ADF Mobile (ODTUG KScope 2014)
PDF
OgH Data Visualization Special Part III
PDF
OgH Data Visualization Special Part II
PDF
OgH Data Visualization Special Part I
PDF
Oracle day 2014-mobile-customer-case
PPTX
oow2013-adf-mo-bi-le
PDF
Goodbye Nightmare : Tops and Tricks for creating Layouts
PDF
Dont Reinvent the Wheel: Tips and Tricks for reuse in ADF
PDF
ADF Mobile : Best Practices for Developing Applications with Oracle ADF Mobile
PPTX
ADF Mobile - an intro for Developers
PPTX
An ADF Special Report
PPTX
...and thus your forms automagically disappeared
PPTX
Odtug2011 adf developers make the database work for you
Talk to me Goose: Going beyond your regular Chatbot
Extending Oracle SaaS Using Oracle Cloud UX Rapid Development Kit
NO CODE : Or How to Extend Oracle SaaS with Oracle Visual Builder Cloud Service
Real life-maf-2015-k scope-final
Reaching out from ADF Mobile (ODTUG KScope 2014)
OgH Data Visualization Special Part III
OgH Data Visualization Special Part II
OgH Data Visualization Special Part I
Oracle day 2014-mobile-customer-case
oow2013-adf-mo-bi-le
Goodbye Nightmare : Tops and Tricks for creating Layouts
Dont Reinvent the Wheel: Tips and Tricks for reuse in ADF
ADF Mobile : Best Practices for Developing Applications with Oracle ADF Mobile
ADF Mobile - an intro for Developers
An ADF Special Report
...and thus your forms automagically disappeared
Odtug2011 adf developers make the database work for you

Recently uploaded (20)

PDF
Complete Guide to Website Development in Malaysia for SMEs
PPTX
history of c programming in notes for students .pptx
PDF
Cost to Outsource Software Development in 2025
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
assetexplorer- product-overview - presentation
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Transform Your Business with a Software ERP System
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
AutoCAD Professional Crack 2025 With License Key
PPTX
L1 - Introduction to python Backend.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
medical staffing services at VALiNTRY
Complete Guide to Website Development in Malaysia for SMEs
history of c programming in notes for students .pptx
Cost to Outsource Software Development in 2025
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
Operating system designcfffgfgggggggvggggggggg
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
How to Choose the Right IT Partner for Your Business in Malaysia
assetexplorer- product-overview - presentation
Reimagine Home Health with the Power of Agentic AI​
Transform Your Business with a Software ERP System
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Salesforce Agentforce AI Implementation.pdf
AutoCAD Professional Crack 2025 With License Key
L1 - Introduction to python Backend.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Design an Analysis of Algorithms I-SECS-1021-03
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
medical staffing services at VALiNTRY

MAF push notifications

  • 1. ADF Mobile : Push Notifications DOAG ADF Spotlight Webinar, June 6th 2014
  • 2. Who Am I • Luc Bors • Principal Consultant • AMIS, Netherlands
  • 3. Agenda • ADF Mobile Overview Architecture • Push Notifications Overview • Push Notifications Cloud Messaging Part • Push Notifications Provider Part • Push Notifications ADF Mobile Part
  • 6. Example • Select device • Send message • Get notified
  • 7. Push Notifications • Subscribe to Messaging Service • Receive token • Register with Enterprise app • Enterprise app Pushes message to Messaging Service • Messaging Service delegates message to device(s)
  • 9. Setup GCM • Google Cloud Project • Google Cloud Messaging API is enabled • API key
  • 10. Setup APNS • iOS Developer account • App Id and Provisioning profile – Make sure to check the Push Notification Service when you create the new App Id • SSL Certificate
  • 11. Create a Provider Application
  • 12. Prepare Provider Application • Add gcm-server.jar (for GCMS) • Add javaPNS.jar (for APNS)
  • 13. Code Behind the Button • Class to push a message to a device. public void pushNow(ActionEvent actionEvent) { ….. Logic to get selected row… String target = (String)curr.getAttribute("DeviceToken"); String type = (String)curr.getAttribute("DeviceType"); if (type.equalsIgnoreCase("Android")) { pushMsgAmdroid(target, this.message); } else { pushMsgIos(target, this.message); }
  • 14. Server Side for Android • Sending the message String sound = "default"; Message message = new Message.Builder() .delayWhileIdle(true) .addData("alert", msg) .addData("sound",sound) .addData("FeatureName", "Sessions") .addData("SessionId", "12") .build(); Result result; try { result = sender.sendNoRetry(message, regId); }
  • 15. Server Side for iOS • Sending the message /* Build a blank payload to customize */ PushNotificationPayload payload = PushNotificationPayload.complex(); /* Custom the payload */ payload.addAlert(msg); payload.addBadge(1); payload.addCustomDictionary("FeatureName", "Sessions"); payload.addCustomDictionary("SessionId", "12"); Push.payload(payload, KEYSTORE_LOCATION, KEYSTORE_PASSWORD, false, target);
  • 16. Preparing ADF Mobile • Register Application Life Cycle Listener • LifeCycleListener must implement oracle.adfmf.application.PushNotificationConfig interface. – This interface provides the registration configuration for push notifications
  • 17. ApplicationLifeCycleListener • ApplicationLifeCycleListener – In the Start() Method create a new PushNotificationListener() public void start() { // Add code here... EventSource evtSource = EventSourceFactory.getEventSource( NativePushNotificationEventSource. NATIVE_PUSH_NOTIFICATION_REMOTE_EVENT_SOURCE_NAME); evtSource.addListener(new PushNotificationListener()); }
  • 18. The PushNotificationListener • In the PushNotificationListener – OnOpen() // receive token – OnMessage() // handle notification – OnError() public void onOpen(String token) { // Invoked during the Push Notification registration process. // The parameter "token" contains the token received from APNs or GCMs // that uniquely identifies a specific device-application combination. ValueExpression ve = AdfmfJavaUtilities.getValueExpression( "#{applicationScope.deviceToken}", String.class); if (token != null){ ve.setValue(AdfmfJavaUtilities.getAdfELContext(), token); } else{ ve.setValue(AdfmfJavaUtilities.getAdfELContext(), "dummy Token"); } }
  • 19. Token Registration • Use a webservice to send the Token to the provider Application • Provider stores token and uses it when sending notifications (remember the “code behind the button” public void pushNow(ActionEvent actionEvent) { ….. Logic to get selected row… String target = (String)curr.getAttribute("DeviceToken"); String type = (String)curr.getAttribute("DeviceType"); if (type.equalsIgnoreCase("Android")) { pushMsgAmdroid(target, this.message); } else { pushMsgIos(target, this.message); }
  • 20. All is there. • Cloud Services are setup • Provider app is created • Device Token can be sent to and stored at provider app • LETS PUSH ! And work with the notification
  • 22. onMessage() Working with the Notification public void onMessage(Event event) { AdfELContext adfELContext = AdfmfJavaUtilities.getAdfELContext(); JSONBeanSerializationHelper jsonHelper = new JSONBeanSerializationHelper(); try {PayloadServiceResponse serviceResponse = (PayloadServiceResponse)jsonHelper.fromJSON( PayloadServiceResponse.class, event.getPayload()); ValueExpression notificationPayloadBinding = AdfmfJavaUtilities.getValueExpression( "#{applicationScope.notificationSessionId}", String.class); notificationPayloadBinding.setValue( AdfmfJavaUtilities.getAdfELContext() , serviceResponse.getSessionId()); AdfmfContainerUtilities.gotoFeature( "com.tamcapp.mobilebook.ses.ConferenceSessions"); }
  • 23. Badging // also, lets decrease the application icon badge by one int currentBadge = AdfmfContainerUtilities.getApplicationIconBadgeNumber(); if (currentBadge > 0) { AdfmfContainerUtilities.setApplicationIconBadgeNumber( currentBadge - 1); }
  • 24. In the feature… • Use FeatureLifeCycleListener – Activate() Method public void activate() { Boolean notified = (Boolean)AdfmfJavaUtilities.evaluateELExpression( "#{applicationScope.notified}"); if(notified.booleanValue({ AdfmfContainerUtilities.invokeContainerJavaScriptFunction( AdfmfJavaUtilities.getFeatureName(), "adf.mf.api.amx.doNavigation”, new Object[] { "featureActivated" });} }
  • 25. DEMO
  • 26. Push Notification - Summary • Configuration can be complicated (Especially on iOS) • Listeners, Listeners, Listeners – ApplicationLifeCycle – PushNotification – FeatureLifeCycle • Send Notification (optional with Payload) • onMessage() – Get Payload – Call feature • In Feature – Work with payload
  • 27. Luc Bors, AMIS, The Netherlands Luc.Bors@amis.nl LucBors@gmail.com Follow me on : @lucb_