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

Native Development

Reply
Regular Contributor
alexchristou
Posts: 56
Registered: ‎03-02-2012
My Device: 9780 & Playbook 32GB & Dev Alpha
My Carrier: Vodafone GR

About BBM registration

Hello community. 

Is there a way i can make the bbm registration qml appear only the very first time the app is launched?

I tried all the sample apps, and everytime i launch a bbm connected app i get the registration qml with the continue button for the main.qml   

If i cant make it never appear again once registration is succesful, how about make it disappear after 2-3 seconds on its own?

Any advice?

Please use plain text.
Developer
greenback
Posts: 492
Registered: ‎10-17-2010
My Device: BlackBerry Z10, DAC

Re: About BBM registration

There are new samples posted to the Community Repo on GitHub.

 

Check them out. They're great. 

https://github.com/blackberry/Cascades-Community-Samples

  1. BBMBaseSampleRegistration
  2. BBMQtInviteToDownload
  3. BBMQtProfile
  4. BBMQtProfileBoxSample
  5. BBMQtRegistration
  6. BBMSPUserProfile

Once a user has successfully registered with BBM, the dialog will not appear. Permissions are set once.


:Rockon:

Please use plain text.
Regular Contributor
alexchristou
Posts: 56
Registered: ‎03-02-2012
My Device: 9780 & Playbook 32GB & Dev Alpha
My Carrier: Vodafone GR

Re: About BBM registration

i am checking bbmqtprofile bbmptinvite and bbmqtprofileboxsample in my dev alpha and the registration qml page appears every time i open the sample apps.it doesnt ask for registration again. It sais bbm registration succeeded. Press continue and has a buuton beneath the message. This is the part i want to avoid.since once registered how can i hide this procedure.

Please use plain text.
Developer
greenback
Posts: 492
Registered: ‎10-17-2010
My Device: BlackBerry Z10, DAC

Re: About BBM registration

Replace registration.qml with main.qml

 

You do not need to show registration.qml. 

Please use plain text.
Developer
jaiaca
Posts: 96
Registered: ‎10-06-2012
My Device: Z10
My Carrier: Rogers

Re: About BBM registration

As mentioned by greenback, you don't need the registration qml or any of the qml in those samples.

Take a look at my blog article on exactly your issue. You only need to strip out the functionality and use your appName.qml file

http://twocasualcoders.com/2012/11/10/qml-and-bbm-together-at-last/
Jason I. Carter
Follow me @jasonicarter
Built For BlackBerry - WordsPlus & WordsPlus: Free Edition | word search has never had it so good
www.twocasualcoders.com | never casual on quality
Please use plain text.
Developer
jaiaca
Posts: 96
Registered: ‎10-06-2012
My Device: Z10
My Carrier: Rogers

Re: About BBM registration

I've added another article on the topic, showing more code in detail...Hope this helps.

http://twocasualcoders.com/2012/11/14/qml-and-bbm-together-at-last-part-2/

If you like the article. Like this post :smileyhappy:
Thanks
Jason I. Carter
Follow me @jasonicarter
Built For BlackBerry - WordsPlus & WordsPlus: Free Edition | word search has never had it so good
www.twocasualcoders.com | never casual on quality
Please use plain text.
Developer
StevenKader
Posts: 634
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Re: About BBM registration

Thanks.  The HelloBBM sample is great.  Only question I have is if there is no network my app is showing what looks like a system error (see attached).  I don't like this error message because I don't control it and don't like the wording.  Also, the user doesn't really know I am trying to connect to BBM at this point so they get confused.

 

Does anyone agree with me on this?  Any thoughts.

 

IMG_00000010.png


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Please use plain text.
Developer
jaiaca
Posts: 96
Registered: ‎10-06-2012
My Device: Z10
My Carrier: Rogers

Re: About BBM registration

Hi JaredCo, thanks for the comments. The attached image doesn't show up properly so I'm going to guess that the message you're referring to is this...

 

 case RegistrationState::NoDataConnection:
        m_statusMessage = tr("Check your Internet connection and try again.");
        m_temporaryError = true;
        break;

 

This message is a "system error" of sorts. As you can see the message is hard coded (in the registrationHandler.cpp file) but you can change it. If you don't want to change it here, there's another thing you can do which is prehaps a nicer approach.

 

See the variable "m_temporaryError" ? This is attached to a Property which is accessible in your QML registration page. Assuming you like how this particular area works, you could create an enum with values that coorespond to different types of errors - for example noDataConnection 1, maxAppsReached 2, pending 3, etc

 

Then make these values accessible as a Q_Porperty for your QML...Once registration takes place, if you get an error and its property value is 1 aka "noDataConnection" then you can set the message however you'd like in QML.

 

Or you can just by pass all error by calling finishedRegistration() in all of the cases. This will cause a signal to be emitted that will in turn trigger your "show()" method in the appName.cpp file

 

Hope that helps

Jason

Jason I. Carter
Follow me @jasonicarter
Built For BlackBerry - WordsPlus & WordsPlus: Free Edition | word search has never had it so good
www.twocasualcoders.com | never casual on quality
Please use plain text.
Developer
StevenKader
Posts: 634
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Re: About BBM registration

Hi Jason,

 

Thanks for replying.   I had already done what you mentioned to make sure there were no messages generated from the registration.cpp.  This seems to be a system message which you could see if you run HelloBBM without wifi from a fresh install (never regsitered before).  I've attached the image again so you can see it.  Let me know what you think.  Thanks.

 

msg.png


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Please use plain text.
Developer
jaiaca
Posts: 96
Registered: ‎10-06-2012
My Device: Z10
My Carrier: Rogers

Re: About BBM registration

Ah! I see what you mean. I agree it's a system message, similar to trying to open BlackBerry World or Games without internet connection...Never thought about trying to get rid of it, though.

 

You could try something like...


if ( isInternetAvailable() ) {

do registrationHandler code

} else {

skip registration code

}

 

This will prevent the message from coming up because it never tries to register if there's no internet connection. But I don't exactly know how to test for internet connection because I don't need to in my app, bbm or scorelooop inform me and then I update the user appropriately (probably not the best approach)

Jason I. Carter
Follow me @jasonicarter
Built For BlackBerry - WordsPlus & WordsPlus: Free Edition | word search has never had it so good
www.twocasualcoders.com | never casual on quality
Please use plain text.