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: 165
Registered: ‎10-04-2010
My Device: P'9982 & Z10
My Carrier: alfa Lebanon

onsharecontent Not Being Invoked if App is Running

I am building an application with WebWorks.

Documentation says onsharecontent is "Invoked when shared content arrives at the recipient." However it is not the case, when the application is running, nothing is received not even if you close the app and run it again. On ther other hand, if the app was initialy not running and the content was sent, then the icon shows the red star (icon splat) and the content is recieved.

 

blackberry.bbm.platform.users.onsharecontent is being called on intialization.

Should I set a timer to keep calling this function repeatedly? I thought it would automatically be invoked when content is shared.

 

Any help is greatly appreciated.

Thanks

Wadi
Developer
Posts: 409
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: onsharecontent Not Being Invoked if App is Running

Hi,

 

I just implemented that this morning, and it works really well, so easier than Java's implementation of BBM!

 

- If my application is running, the onsharecontent is fired

- If it is not running, the icon automatically get a red star and when BBM is initialized, it fires the onsharecontent.

 

Sometimes it takes a long time to receive the bbm message (1-2 min)

Juste make sure you have the latest Webworks SDK.

Can you tell on which device / Os version you test?

Developer
Posts: 165
Registered: ‎10-04-2010
My Device: P'9982 & Z10
My Carrier: alfa Lebanon

Re: onsharecontent Not Being Invoked if App is Running

I've tested on a Bold 9900, Torch 9860 and Curve 9300.

 

I didn't wait a long time, I will try testing again and waiting. it's just that when the app was closed, the app quickly got the star icon so I figured it should take the same time when the app was running.

 

Where are you calling the onsharecontent function?

Wadi
Developer
Posts: 409
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: onsharecontent Not Being Invoked if App is Running

I initialize my onsharecontent within a setTimeout that I call after my first screen has been pushed with BBUI.js

 

I'll test on 9300 and 9860 to see what happens. I did the work on a 9790 and a 9320