2

每个人都有一个简单的问题,有没有可能通过编程在应用程序中获取 Blackberry BBM Logs 的方法。

我完成了以下任务:-

  1. 在项目中下载并集成 BBM SDK。
  2. 遵循BBM 开发指南

这是我的代码:-

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。

4

1 回答 1

1

抱歉,这是不可能的——因为我认为 BB 将访问程序中的聊天记录视为潜在的安全隐患。

于 2013-11-21T10:56:48.383 回答