您不需要使用BBM SDK從您的應用程序向其他用戶發送PIN消息。 BB引腳不僅限於BBM。它是Blackberry的唯一標識符,您可以使用它來使用Pin發送消息。您還可以使用您的PIN和BBM一起在BBM中發送消息。如果您需要在文本框中輸入該針腳,併發送預填充消息,則不需要使用BBM。您可以使用使用以下方法發送PIN消息
public static void sendPinMessage(String address,String body)
{
Store store = Session.getDefaultInstance().getStore();
//retrieve the sent folder
Folder[] folders = store.list(Folder.SENT);
Folder sentfolder = folders[0];
//create a new message and store it in the sent folder
Message msg = new Message(sentfolder);
PINAddress recipients[] = new PINAddress[1];
try{
//create a pin address with destination address
recipients[0]= new PINAddress(address,"My app");
}
catch (AddressException ae)
{
Log.Error(ae,"Check address");
}
try{
//add the recipient list to the message
msg.addRecipients(Message.RecipientType.TO, recipients);
//set a subject for the message
msg.setSubject("Subject");
//sets the body of the message
msg.setContent(body);
//send the message
Transport.send(msg);
}
catch (MessagingException me)
{
Log.Error(me,"Message excpetion in sending pin");
}
}
thanx for suggetion。我們如何在模擬器中測試它? – Hitarth 2011-12-23 12:04:44
我們不能在模擬器中測試引腳信息。您必須使用兩個設備進行測試 – rfsk2010 2011-12-23 12:05:56
好。我們可以添加電子郵件登入bbm PIN嗎? – Hitarth 2011-12-23 12:15:39