2013-11-21 170 views
2

對於每一個簡單的問題,是否有任何可能的方式通過編程獲得黑莓BBM日誌的應用程序。獲取BBM聊天記錄

以下任務我做: -

  1. 下載&在項目整合BBM SDK。
  2. 按照BBM Development Guide

這裏是我的代碼: -

public void getBBM_Logs() 
    { 
     BBMPlatformContext platformContext =null; 
     try 
     { 
      platformContext = BBMPlatformManager.register(new MyBBMAppPlugin()); 


      if(platformContext != null) 
      { 
       ContactListService contactListService = platformContext.getContactListService(); 
       BBMPlatformContactList contacts = contactListService.getContactList(); 
       Enumeration contactsEnum = contacts.getAll(); 

       while(contactsEnum.hasMoreElements()) 
       { 
        BBMPlatformContact contact = (BBMPlatformContact)contactsEnum.nextElement(); 

        add(new LabelField(contact.getDisplayName())); 
       } 

      } 

     } 
     catch (ControlledAccessException e) 
     { 
      // The BBM platform has been disabled 
     } 


     if (platformContext != null) 
     { 
      MyBBMPlatformContextListener platformContextListener; 
      platformContextListener = new MyBBMPlatformContextListener(); 
      platformContext.setListener(platformContextListener); 
     } 

    } 


    private class MyBBMPlatformContextListener extends BBMPlatformContextListener 
    { 
     public void accessChanged(boolean isAccessAllowed, int accessErrorCode) 
     { 
      if (!isAccessAllowed) 
      { 
       // You cannot access the BBM platform 
      } 
     } 

     public void appInvoked(int reason, Object param) 
     { 
      // Code for handling different contexts for invocation 
     } 
    } 

    private class MyBBMAppPlugin extends BBMPlatformApplication 
    { 
     public MyBBMAppPlugin() 
     { 
      super("57888721-1e52-4171-a8a4-0559eab8efdf"); 
     } 
    } 

請讓我知道,是否有任何可能的方式來獲得ChatLogs。

回答

1

對不起,這是不可能的 - 因爲我認爲BB認爲從程序訪問聊天記錄作爲潛在的安全風險。

+0

..謝謝男人! –