Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel
Accepted Solution

Can we use push notiofications in html5 applications? If yes How ? My web app needs to recieve push notifications

Can we use  push notiofications in html5 applications? If yes How ? My web app needs to  recieve push notifications

Developer
Posts: 101
Registered: ‎07-26-2013
My Device: BB 10
My Carrier: All Carriers

Re: Can we use push notiofications in html5 applications? If yes How ? My web app needs to recieve push notifications

Hope this will help you http://pusher.com/tutorials/html5_realtime_push_notifications

-----------------------------------------------------------------------------------------------------
Hit Like if this post found useful
Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Thank u for the links

I will start     following the links  and got the keys today by signing up for ity.

 

 

Please    be with me        till my integrations gets completed.

 

 

Developer
Posts: 101
Registered: ‎07-26-2013
My Device: BB 10
My Carrier: All Carriers

Re: Thank u for the links

Sure...

-----------------------------------------------------------------------------------------------------
Hit Like if this post found useful
Highlighted
Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: Thank u for the links

Please have a look at my another query also.

 

 

Eralier i have dveloped/Built  and published a html5 app in the app world.

 

 

Now I dont know     Iam facing this error

 

 

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/when-Iam-trying-to-build-Run-a-s...

Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Done integrating the push notifications code

What to do next ?

 

Include the JS files in your HTML page

 

1) performed step 1

 

HTML

 

<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="realtime-notifications/src/lib/gritter/js/jquery.gritter.min.js"></script>
<link href="realtime-notifications/src/lib/gritter/css/jquery.gritter.css"rel="stylesheet" type="text/css" />
<script src="http://js.pusher.com/2.1/pusher.min.js"></script>
<script src="realtime-notifications/src/PusherNotifier.js"></script>

 

Establishing a connection to Pusher

 

2)performed step 2

 

js


$(function() {
var pusher = new Pusher('YOUR_APP_KEY');
var channel = pusher.subscribe('my_notifications');
var notifier = new PusherNotifier(channel);
});

 

 

 

My queries are

 

How to Trigger events   ?

 

Triggering events from your server

Make a new file in your application, or open an existing one. This will be used to send notifications to Pusher.    

 

 

 

How to   

Include the Pusher library ?

 

 

I have used as   

 

 

<script src="realtime-notifications/src/PusherNotifier.js"></script>
<script src="realtime-notifications/src/Node.js"></script>

 

 

 

Triggering Events  ?

 

 

I have used as         Node.js

 

 

var Pusher = require('pusher');

var pusher = new Pusher({
appId: '50616',
key: '51cb33412b3fe4182e3b',
secret: '1cb14649d33be4c6d711'
});

pusher.trigger('test_channel', 'my_event', {
"message": "hello world"
});

 

 

 

Please explain what to do now ?   

 

 

Open your html page in one browser window, and hit your script with another. You should see a notification pop up!

 

?   ?

 

Developer
Posts: 101
Registered: ‎07-26-2013
My Device: BB 10
My Carrier: All Carriers

Re: Done integrating the push notifications code

Hi,

   I think you have to add the EventLister. And anyhow I hope these links will clearly explains you what you need. 

 

How to Trigger events   ?

https://developer.mozilla.org/en-US/docs/Web/Guide/DOM/Events/Creating_and_triggering_events 

 

http://www.w3schools.com/js/js_htmldom_events.asp 

 

how to include pusher library?

 

http://pusher.com/docs/javascript_quick_start 

 

http://pusher.com/docs/client_libraries

 

 

-----------------------------------------------------------------------------------------------------
Hit Like if this post found useful
Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: Done integrating the push notifications code

Due to the other error like failed to find java.exe and bbwp.exe not working.

 

 

I have un installed Bb webworks sdk 2.3.1.5

 

 

Re  installing it gain now.

 

Wait for my reply  again  

Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: Done integrating the push notifications code

[ Edited ]

Ok       problem solved  signing the tools.

 

 

Now Iam able to build teh app using cmd prompt

 

 

I got the error

 

 

 

C:\Program Files\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5>bbwp
C:\apps\YuppTV.zip -o C:\apps\Output2
[INFO] Parsing command line options
[INFO] Parsing bbwp.properties
[INFO] Validating application archive
[INFO] Parsing config.xml
[INFO] Populating application source
[INFO] Compiling BlackBerry WebWorks application
I/O Error: C:\Users\Shravan\AppData\Local\Temp\widgetGen.13793006571375275990390
.tmp\YuppTV (The system cannot find the file specified)
[ERROR] RAPC exception occurred

 

 

Actaully I have  copied the folder  "pusher-html5-realtime-push-notifications-c61b0e1"     came from  github

 

 

 

I renamed that folder as  "realtime-notifications" and pasted in my Application "YuppTV"

 

 

Please help me

 

 

 

 

Copied Node.js

 

 

varPusher=require('pusher');var pusher =newPusher({  appId:'APP_ID',  key:'APP_KEY',  secret:'APP_SECRET'});pusher.trigger('my-channel','my-event',{"message":"hello world"});

 

 

in   folder                    "realtime-notifications"

 

 

 

Two errors  related              to .gitignore      so  I deleted   files named gitignore 

 

 

 

 

 

 

 

Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: Done integrating the push notifications code

The link            http://html5-realtime-push-notifications.phpfogapp.com/        is not working or opening