Swarm Documentation API Reference

Frequently Asked Questions


How are Cloud Data keys stored with regards to particular apps?
Cloud Data keys are unique per-app-per-user, so if two apps use the same key (i.e., levelProgress) there will be no risk of conflict. The same goes for two users in the same app having the same key: user1's "levelProgress" is different than user2's "levelProgress".


Hey, can you hook me up with a cool Swarm badge for my app's icon?
Sure, no problem. We've got some classy Swarm badges that you can put on your app's icon to show the world that your app is Swarm-enabled. Users want to know which apps have social features, and the Swarm badge is a great way to show them! Swarm badges are available here.


Can users login without an account? Do you support Guests?
Absolutely! By default, Swarm is configured to only allow non-Guest users. Guest accounts have a lower retention rate, and frequency of use than full accounts. However, if you'd like to enable Guests to login, all you need to do is:
// Allow guest accounts
// Call before calling Swarm.init(...)
Swarm.setAllowGuests(true);

What permissions does Swarm require?
We understand that permissions are important, so Swarm only requires a few. Not using the Virtual Store? Simply comment out the third permission.
<!-- Allows users to use social features -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- Allows for seamless online/offline support -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- Optional. Only required if using the Virtual Store.
Helps prevent fraud and create a secure environment. -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

I'm using a framework and can't extend SwarmActivity. What do I do?
Swarm will just need to be notified as activities take the foreground (and leave the foreground), so that Swarm can properly show notifications like "Achievement Unlocked" and "Item Purchased". Just add the following to each of your activities.
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Swarm.setActive(this);
}

public void onResume() {
    super.onResume();
    Swarm.setActive(this);
}

public void onPause() {
    super.onPause();
    Swarm.setInactive(this);
}

How can I make calls to init even faster?
To improve performance during initialization, call the preload function as soon as possible (i.e., during a splash screen or other asset loading screen)
preload(myActivity, APP_ID, "APP_KEY");
where myActivity is a reference to the current activity, APP_ID and APP_KEY are the integer App ID and string App Key for the app (shown in the app's App Details tab).


How do you guys at Swarm make money anyway?
Swarm is completely free for developers to use, and we intend to keep it that way. You're welcome to implement as many or as few features as you like without worrying about being charged if your app gets featured. We don't charge a monthly subscription either! We make our money when users purchase items from your Virtual Store. When a user buys an item, we collect a small percentage of the transaction in exchange for providing you with an easy way to sell goods to your users. It's really that simple.


I have a question or suggestion. How do I contact the Swarm team?
Feedback, questions, ideas, and suggestions are always welcome (and highly encouraged)! Please contact the team via the Swarm Support Center. We pride ourselves on top-notch service, so we'll do everything we can to get back to you with a timely and thorough response.