smack

building, authenticating, and parsing with the Smack library

我怕爱的太早我们不能终老 提交于 2019-12-04 19:25:39
I am trying to connect to Firebase Cloud Messaging by using smack library. I don't have much knowledge of the Smack API. After reading the Firebase docs, I see that the connection must be authenticated and there are a series of responses back and forth between "app server" and Cloud Connection Servers. According to the docs, I must create a Sasl Plain authentication. I don't know how to implement this. But after reading some posts by other StackOverFlow users I see that I must create an authentication class. Specifically, I was reviewing the answers and comments on "Gtalk XMPP SASL

X-FACEBOOK-PLATFORM authentication with SMACK Java library using OAuth 2.0

二次信任 提交于 2019-12-04 18:54:09
问题 First post here so please be gentle. I'm building a facebook chat client, using Smack library. I'm using X-FACEBOOK-PLATFORM method in order not to save any passwords. I had it working properly using oauth 1.0, and want to change it to 2.0, cause of the october 1st deadline ;p. From what I understand the only thing I'd have to do in order to migrate to 2.0 is removing "sig" and "session_key" parameters and adding an "access_token" parameter, but I'm getting an "SASL authentication X-FACEBOOK

Not able to get LastActivity of a jabberId

心已入冬 提交于 2019-12-04 16:42:44
I am trying to get last offline time of a particular jabberId by this piece of code. LastActivityManager lActivityManager = LastActivityManager.getInstanceFor(MessageService.getConnection()); lActivityManager.isLastActivitySupported(to + "@localhost"); Log.v(TAG, "Last Activity: " + lActivityManager.getLastActivity(to + "@localhost")); LastActivity activity = lActivityManager.getLastActivity(to + "@localhost"); But I am keep getting service-unavailable exception. I have checked the server configuration but this feature is implemented correctly from server side. Have you added other jabber id

get online users(Roster entries) using smack 4.1 in android

≡放荡痞女 提交于 2019-12-04 11:54:39
问题 I have been trying to get roster entries using smack 4.1 beta 2 in android. https://github.com/igniterealtime/Smack/wiki/Smack-4.1-Readme-and-UpgradeGuide Quotes from above link.. "Roster now follows the Manager pattern (use Roster.instanceFor to obtain an instance, no more XMPPConnection.getRoster)" First of all i am not able get the "Roster" object, libraries that i have imported may not have that package or i miss any lib here? I m using all the libraries mentioned in above link. Can

How to create an account from Smack 4.1

青春壹個敷衍的年華 提交于 2019-12-04 10:49:53
I'm trying to create an account from Smack for Android on jabber.at. Here is my code : XMPPTCPConnectionConfiguration conf= XMPPTCPConnectionConfiguration.builder() .setServiceName("jabber.at") .build(); XMPPTCPConnection connection = new XMPPTCPConnection(conf); connection.addConnectionListener(xmppConnectionListener); connection.connect(); AccountManager accountManager = AccountManager.getInstance(connection); Map<String, String> map = new HashMap<String, String>(); map.put("username", usr); map.put("password", pwd); map.put("email", email); accountManager.createAccount(usr, pwd, map); I got

Delivering upstream messages via XMPP on Firebase Cloud Messaging misconceptions

僤鯓⒐⒋嵵緔 提交于 2019-12-04 10:44:00
I am trying to set up FCM functionalities into my app. At the moment, I would like to display a button such that when the user presses the button an upstream message is generated which is sent to Google's CCS. It is my understanding that this upstream message will be turned into an XMPP stanza by the Google CCS. Then, it will be delivered to the phone that has the id I set to when creating the upstream message. After reading the documentation on FCM from google, I see that it is very simple to create an upstream message: FirebaseMessaging fm = FirebaseMessaging.getInstance(); fm.send(new

XMPP events on Android

99封情书 提交于 2019-12-04 10:00:00
I'm trying to develop a background process that intercepts a XMPP message and performs an action, I'm using asmack as the main XMPP library. I presume I need a broadcastReciever that responds to a specific intent. The question is how to raise the intent? It must be possible as this functionality is present in the google talk client. many thanks in advance. If you really want to achieve this behavior, you might think about a persistent background service running the asmack XMPP client. The listener method (i.e. processPacket) of your XMPP client could raise an intent. You could then catch this

How to set/get profile data with XMPP using Smack

我是研究僧i 提交于 2019-12-04 09:45:38
I am working on a XMPP client on Android, using the Smack library. The roster/messaging/presence stuff is running very well. However, I didn't find a way to store additional profile information (userpicture, the dogs name, ...). The only way I see from googling is using VCards. But it simply did not work. I tried the following: VCard vCard = new VCard(); vCard.load(connection); vCard.setEmailHome("meine_home@email.de"); vCard.setLastName("Scheller"); vCard.setField("blafasel", "asdf"); vCard.save(connection); Then I was looking for a way to see that VCard information. It did neither show up in

File transfer using smack in android apps.

谁说胖子不能爱 提交于 2019-12-04 08:42:40
问题 This error come in log. from='kutbi1@360degree/Smack' to='akash@360degree/Smack' type='error' id='hK1L6-5'> <si xmlns='http://jabber.org/protocol/si' id='jsi_191216212994140179' mime-type='image/png' profile='http://jabber.org/protocol/si/profile/file-transfer'> <file xmlns='http://jabber.org/protocol/si/profile/file-transfer' name='this_old_house.png' size='12623'> <desc>You won&apos;t believe this!</desc></file> <feature xmlns='http://jabber.org/protocol/feature-neg'> <x xmlns='jabber:x

Unable to get presence of roster by using smack, openfire

梦想与她 提交于 2019-12-04 06:51:51
I am new to smack API. I am trying to develop a chat application where I was trying for setting and getting the presence. When I change the presence of a user, its working perfectly fine and it is getting reflected in the Openfire Server. But when I tries to get the Presence of a user, I am always getting the status as 'unavailable' even if his presence in openfire is showing as 'available'. I am using the following code to set the status. Presence presence = new Presence(Presence.Type.available); presence.setStatus("Online, Programmatically!"); presence.setPriority(24); presence.setMode