Smack API User search - xmpp

I'm try to implement a user search on top of my working Smack-API based jabber client.It can create user using:
AccountManager manager = conn.getAccountManager();
manager.createAccount(usename,password);
However I need to add a functionality that will first search for "existing" user before it creates the account, but I can't find any straightforward way to do it. Anyone can provide me hints?
Thanks.

Apparently what's needed is just to catch the error code 409 in the XMPPException, as createAccount throws exception if user exist.

Although you don't actually need the functionality you requested any more (according to your own answer), I will answer the original question anyway for future reference.
There is a class called UserSearchManager in Smack that can be used for this purpose.

Easiest way is to log in as the user once, without sending presence. In general, we try to find all of the ways you could answer this question without having the ability to log in as the user, and eliminate them, in order to help prevent spim.

Related

Firebase notifications Swift

Yes I know that this has been asked on StackOverflow before but I just can't find exactly what I am looking for. So what I would like is when a user (user1) send a message to another user (user2) , for user2 to get a notification saying they have a new message from user1. So far I have set my app up so that I can send a push notification from the Firebase Console, but not so that the app does it automatically. I think I need an observe function but I am not quite sure what to do or the code for it?
Thank you so much for all the help! This is my first time with Firebase.
You can just use Cloud Functions.
It simply triggers a Function when an Event occurs.
For example whenever a new message added to a node you can run a function that sends a Notification to the user
Check the Documentation
Also check this sample which matches what you need
I have asked same question some time ago. The thing that was bothering me was why should I use Cloud Functions and write and deploy functions for it in javascript if I just wanted to send Notifications just between two users?
So I checked out other options and setup everything in just about few minutes without writing any javascript functions in the Firebase Cloud Functions.
Well it depends on what you will exactly need but in my case using Cloud Functions just to handle that was nonsense. If you are in the same situation as I was you can use OneSignal like I did. There is also my question on this and you can check it out here.
you can try this it can worked for me sending notification through fire base cloud
https://github.com/firebase/quickstart-ios
https://github.com/firebase/quickstart-ios/issues/286#issuecomment-304992090

Gatling Storing variables between scenarios

I am using Gatling and am running into an issue implementing an integration test. The test I am running has two parts (scenarios):
The first part is a simple GET request to verify expected server responses. In this step, it returns a form's configuration ID as well as other properties of the form.
In the next step, I am hitting PUT route which updates various properties of this form's configuration for testing of this route and other functionality through the back ends of an application.
The issue with these steps is that after running the second step, if there are any forms saved under that configuration, it will clone a copy for security purposes and changes the ID. Long story short, the same ID does not persist from test to test.
My question is: Is there a way within Gatling to run SQL Queries to get values and store them and then pass them? OR is there a way to store a variable from the GET method and pass it in in the second scenario's PUT method. I know there is Gatling's .saveAs() method, but I believe the scope of this function is only scenario.
Please notify me for further clarification and details; thanks in advance.
The Google group link only shows you how to share (&cache) data between different user-sessions.
If you are looking for sharing data between "scenarios" rather than "user sessions", you should check out Peter's answer: https://stackoverflow.com/a/43061278/1395126
It's the only information I can find on the internet today that really shows you how to share data between scenarios in Gatling.
IMHO, it's super important to look out for the line of "// Set it here" comment. This is THE secret about sharing data among scenarios. Without setting session attribute first or accessing the "CreateId" directly in another scenario could not work.
This answer: https://groups.google.com/forum/#!topic/gatling/bfpKd_9d6gk can probably be used to handle your use case.

salesforce trigger to update a visualforce page

I am fairly new to salesforce and I'm having a problem statement which I'm unable to solve.
There is a Custom object named XYZ which has the fields: username, points and Id. Now I want that whenever a particular user points gets updated I get a pop up notification in a visualforce page. I am fairly familiar with the concept of Trigger but I don't know how to use that trigger to update the visualforce page with a pop up notification.
I think you may want to rethink your approach. Triggers are completely data driven, and will perform an action on data within the database, but they aren't going to give you any kind of interaction on the front end save for error messaging.
Your details are a little sketchy, but for the pop-up you probably want to use a Javascript alert, or maybe even some kind of modal window.
If you give more details about the process you're trying to achieve it might be a little easier to give you a more solid response.
Finally, I ended up changing my approach and creating a PushTopic for the update. And subscribed to this PushTopic using cometd javascript library.

In-App Notifications?

I'm trying to create functionality in my app that would allow me to release news updates (Via a server) to those using the app, similar to what is found in Doodle Jump:
http://farm8.staticflickr.com/7143/6463110847_d485681dac.jpg
Any sample code or ideas would be helpful.
You'll probably need to create an API/web service that your app calls on launch (or when entering foreground)...you could populate that with a database that just gives the entries since the last sync...or just returns some response that you've set up. The response should be JSON or XML formatted (I vote JSON) and then in your app, you call it, parse the response, and place/manipulate it however necessary
http://mobileorchard.com/tutorial-json-over-http-on-the-iphone/
There are a lot of options here. In any case you will need a web server that hosts these news postings. The route that I would take is some kind of blog site, where you can easily manage posts. Then upon launching the app you make a web service call to said blog and get the news posts. You will need to keep track locally of which posts were read by the user in order to keep the badge count correct.
You could also roll your own server, but I don't really see the point for something so simple.
Another option is a web-service such as Parse
This question is too vague for code samples as we would be essentially writing the entire solution for you in order for it to make sense.
If you have further questions into how to leverage these web services, how to load the feed, how to display it etc... Break it up across multiple questions.
There's a service doing this called Converser, if you're still looking.

how can i update my avtar in xmpp using iphone SDK?

how can i update my avtar - login user avtar (photo) in xmpp using iphone SDK (XMPPStream) ?
i have XMPPvCardAvatarModule (but not having method description) so not able to get how to use its methods to update avtar(image) ?? Can any one post sample code & links to understand that, i am stuck with this problem !! Thanks.
Most folks use XEP-153 for avatars. But please be careful implementing this. If you get your hash logic wrong, and you don't do negative caching, it wreaks havoc on the network as your client constantly re-queries for vcards that will never match the hash they're given. Please do NOT set your client to send vcard queries to everyone on your roster every time you log in -- please heed the MUST in the XEP for caching avatars, or do NOT implement this feature.
Also, please be aware the community hopes to one day move to XEP-84, which has the potential to be more efficient in certain cases.