public class PushtechAppBuilder extends Object
Constructor and Description |
---|
PushtechAppBuilder(Context ctx)
This a constructor of the PushtechAppBuilder.
|
Modifier and Type | Method and Description |
---|---|
PushtechApp |
build()
This function creates a
PushtechApp with the user's parameters. |
void |
build(PushtechAppbuildAsyncCallback callback)
This function creates a
PushtechApp with the user's parameters. |
PushtechAppBuilder |
saveBackendDeliveries(boolean save)
This function saves or not backend deliveries in database when user received it.
|
PushtechAppBuilder |
setAppId(String appId)
This is mandatory.
|
PushtechAppBuilder |
setAppSecret(String appSecret)
This is mandatory.
|
PushtechAppBuilder |
setGcmSenderId(String... gcmSenderId)
This is mandatory.
|
PushtechAppBuilder |
setNotificationIcon(int notificationIcon)
This function sets the notification icon that showed when a user
received a push notification.
|
PushtechAppBuilder |
setNotificationIntent(Intent intent)
This function sets a intent when user received a push notification.
|
public PushtechAppBuilder(Context ctx)
ctx
- this an application context.public PushtechAppBuilder setAppId(String appId)
appId
- this a string that contains id of app in the push platformPushtechAppBuilder
public PushtechAppBuilder setAppSecret(String appSecret)
appSecret
- this a string that contais the secret key of app in the push platformPushtechAppBuilder
public PushtechAppBuilder setGcmSenderId(String... gcmSenderId)
gcmSenderId
- this a string or array of strings that contains a key
of project created in your google api console.PushtechAppBuilder
public PushtechAppBuilder setNotificationIcon(int notificationIcon)
notificationIcon
- the resource of icon.PushtechAppBuilder
public PushtechAppBuilder setNotificationIntent(Intent intent)
intent
- the custom intent provider by the user.PushtechAppBuilder
public PushtechAppBuilder saveBackendDeliveries(boolean save)
save
- true or false to decide if save or not backend deliveriesPushtechAppBuilder
public PushtechApp build() throws PushtechError
PushtechApp
with the user's parameters.
Register device in gcm server and push platform. This function executes in main thread,
please create a background thread to use it.PushtechApp
{@link
- PushtechError} to catch all errors occurs when register device in push platform.PushtechError
public void build(PushtechAppbuildAsyncCallback callback)
PushtechApp
with the user's parameters.
Register device in gcm server and push platform.callback
- use to notify that user when occurs anything.