com.stackmob.sdk.push
Class StackMobPushToken

java.lang.Object
  extended by com.stackmob.sdk.push.StackMobPushToken

public class StackMobPushToken
extends Object

A push token identifies a specific device for push on a particular platform. The token can then be registered with StackMob and pushed to.

See Also:
StackMobPush.registerForPushWithUser(StackMobPushToken, String, boolean, com.stackmob.sdk.callback.StackMobRawCallback), StackMobPush.pushToTokens(java.util.Map, java.util.List, com.stackmob.sdk.callback.StackMobRawCallback)

Nested Class Summary
static class StackMobPushToken.TokenType
          The supported push platforms a token can be from.
 
Constructor Summary
StackMobPushToken(String token)
          create a token with a string and the default platform
StackMobPushToken(String token, StackMobPushToken.TokenType type)
          create a token with a string and type
 
Method Summary
 String getToken()
          get the token string
 StackMobPushToken.TokenType getTokenType()
          get the token type
static void setPushType(StackMobPushToken.TokenType type)
          Sets the type of push this StackMob instance will do.
 void setTokenType(StackMobPushToken.TokenType type)
          change the token type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackMobPushToken

public StackMobPushToken(String token)
create a token with a string and the default platform

Parameters:
token - the token string

StackMobPushToken

public StackMobPushToken(String token,
                         StackMobPushToken.TokenType type)
create a token with a string and type

Parameters:
token - the token string
type - the platform you're using
Method Detail

setPushType

public static void setPushType(StackMobPushToken.TokenType type)
Sets the type of push this StackMob instance will do. The default is GCM. Use this to switch back to C2DM if you need to

Parameters:
type - C2DM or GCM

getToken

public String getToken()
get the token string

Returns:
the token string

getTokenType

public StackMobPushToken.TokenType getTokenType()
get the token type

Returns:
the type

setTokenType

public void setTokenType(StackMobPushToken.TokenType type)
change the token type

Parameters:
type - the new type


Copyright © 2012 StackMob. All Rights Reserved.