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

Java Development

Reply
New Contributor
vadimaus
Posts: 7
Registered: ‎08-15-2012
My Device: Bold 9780
My Carrier: Fido

Get PIN messages

Hi,

I saw a lot of examples how to send a PIN message pragmatically.. But my question is how can I retrieve pin conversations.. I’m able only to read emails from the ‘store’ but not PIN messages.

 

Thank you for any help.

Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Get PIN messages

[ Edited ]

welcome to the support forums.

edit: see below

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Get PIN messages

I don't disagree with Simon too often, but in my experience a PIN message is just a special case of an EMAIL message. It carries a different type attribute of  Message.PIN_MESSAGE, instead of Message.EMAIL_MESSAGE

 

How exactly are you trying to access these messages?

 

Please use plain text.
Developer
Developer
CMY
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: Get PIN messages

[ Edited ]

To get the pin messages you need to attach the listener to the default store on the device. The code I use is:

Session session = Session.getDefaultInstance();
Store store = session.getStore();
store.addFolderListener( yourlistener );

 

If you want to get the messages already on the device you would use this same method, but you will need to check for the name of the folders under the store. The folders for the actual email account will have the name of the email account but the folders for the PIN messages will have the name "no service book". Here is how I check it:

 

if( (store.list()[i].getFullName().toLowerCase().indexOf("no service book") != -1) ){

  //this is a PIN message folder

}

Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Get PIN messages

ok, good to know!
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
New Contributor
vadimaus
Posts: 7
Registered: ‎08-15-2012
My Device: Bold 9780
My Carrier: Fido

Re: Get PIN messages

[ Edited ]

Hi,

I was trying your solution and got Folder - 'no service book' but message count is 0, however I have an active BBM conversation.

 

Any suggestions to get that working?

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Get PIN messages

BBM and PIN are two completely different things.

 

Please use plain text.
New Contributor
vadimaus
Posts: 7
Registered: ‎08-15-2012
My Device: Bold 9780
My Carrier: Fido

Re: Get PIN messages

Isn't bbm working with pin messages? Isn't it just an application that displays pin messages in a conversation style?

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Get PIN messages

No.

 

Please use plain text.
New Contributor
vadimaus
Posts: 7
Registered: ‎08-15-2012
My Device: Bold 9780
My Carrier: Fido

Re: Get PIN messages

I will apreciate if you will corect me if I'm wrong and explain how to get PIN message.

 

Thank you in advance!

Please use plain text.