public final class AskingPoint
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
AskingPoint.OnCommandListener
Defines a Global Command Handler (listener) that can be set on the AskingPoint singleton, and which is notified
only when Dashboard Commands actually fire for an App.
|
static interface |
AskingPoint.OnCommandResponseListener
Defines a Global Listener that can be set on the AskingPoint singleton and which is notified
when users select a button on an AskingPoint widget.
|
static interface |
AskingPoint.OnTagCommandListener
Defines a Command Handler (listener) that can is set in-line when a location in code is Tagged and
which is always called, regardless of if a Command did or did not fire at the Tag.
|
static interface |
AskingPoint.OnUnreadFeedbackCountChangeListener |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
The AskingPoint SDK Copyright Notice
|
static java.lang.String |
VERSION
Returns the version number of the AskingPoint SDK being used in the App.
|
Modifier and Type | Method and Description |
---|---|
static void |
addEvent(java.lang.String name)
Add a Custom Event.
|
static void |
addEvent(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> data)
Add a Custom Event with additional data.
|
static boolean |
canShowRatingPrompt(android.content.Context context)
Returns true if calling
showRatingPrompt is currently available. |
static void |
flush()
The AskingPoint SDK sends data when Apps start or come into the foreground, and when they shut down or go into the
background.
|
static java.lang.CharSequence |
getApplicationName()
Returns the application name currently shown by the SDK on various AskingPoint widgets, e.g.
|
static java.lang.String |
getApplicationVersion()
Returns the currently reported application version.
|
static android.content.Intent |
getAppStoreRatingIntent()
Returns the current app store intent override that was set with
AskingPoint.setAppStoreRatingIntent(Intent) . |
static long |
getUnreadFeedbackCount()
Returns the number of feedback responses the user has not yet read.
|
static boolean |
isOptedOut()
Reports if the user is currently opted in or out of data collection.
For a complete discussion see the Reference. |
static void |
onStart(android.content.Context context,
java.lang.String apiKey)
Start or continue an AskingPoint session.
Should be called from each Activity 's onStart() method, that uses
AskingPoint services.Every call to onStart must be paired with a call to onStop . |
static void |
onStop(android.content.Context context)
|
static void |
registerGCMSenderIDs(android.content.Context context,
java.lang.String... senderIds)
Register GCM push sender ids.
|
static void |
requestCommandsWithTag(android.content.Context context,
java.lang.String tag)
Request delivery of any commands pending for the supplied tag.
If any commands are delivered, AskingPoint.OnCommandListener , will be given the chance to customize or override the default presentation. |
static void |
requestCommandsWithTag(android.content.Context context,
java.lang.String tag,
AskingPoint.OnTagCommandListener listener)
Request delivery of any commands pending for the supplied tag.
The supplied listener will be called in all cases
when the request is complete. |
static void |
setAge(int age)
Report the Age of the user.
|
static void |
setApplicationName(java.lang.CharSequence applicationName)
Override the default Application Name value defined in AndroidManifest.xml label property.
The AskingPoint SDK sometimes needs to display the Application name to End Users on one of the pop-up widgets, for example Ratings Booster. |
static void |
setApplicationVersion(java.lang.String applicationVersion)
Override the application versionName defined in AndroidManifest.xml.
|
static void |
setAppStoreRatingIntent(android.content.Intent appStoreRatingIntent)
Override the app store intent used for rating prompts.
|
static void |
setEmail(java.lang.String email)
Report the users email address.
|
static void |
setGender(java.lang.String gender)
Report Gender of the user, "M" or "F".
|
static void |
setOnCommandListener(AskingPoint.OnCommandListener onCommandListener)
Set a global CommandListener on the Singleton instance of AskingPoint to receive notifications
Command when Commands fire. |
static void |
setOnCommandResponseListener(AskingPoint.OnCommandResponseListener onCommandResponseListener)
Set a global CommandResponseListener on the Singleton instance of AskingPoint to receives notifications
Command.complete(com.askingpoint.android.Command.Response) when any Command has completed.The primary reason to be interested in these, is to learn which Buttons users selected in the various AskingPoint widgets. |
static void |
setOnUnreadFeedbackCountChangeListener(AskingPoint.OnUnreadFeedbackCountChangeListener onUnreadFeedbackCountChangeListener)
Set a listener to receive notifications when the unread feedback count changes.
|
static void |
setOptedOut(boolean optedOut)
Opt out of data collection.
|
static void |
setUserID(java.lang.String userID)
Report a globally unique identifier for the user.
|
static void |
setUserName(java.lang.String userName)
Report the name of the user.
|
static void |
showCustomerSupport(android.app.Activity parentActivity)
Show the customer support activity.
|
static boolean |
showRatingPrompt(android.content.Context context)
Shows the rating prompt.
|
static void |
startTimedEvent(java.lang.String name)
Start a Timed Event.
This must always be paired with one of AskingPoint.stopTimedEvent(String) or AskingPoint.stopTimedEvent(String, java.util.Map) . |
static void |
startTimedEvent(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> data)
Start a Timed Event with extra data.
This must always be paired with one of AskingPoint.stopTimedEvent(String) or AskingPoint.stopTimedEvent(String, java.util.Map) .There are limits on the length of Timed Event properties, these are as follows: Name - Custom Event names can have a maximum length of 200 characters. Key - Keys in Dictionaries/Maps can have a maximum length of 200 characters. Values - Values Dictionaries/Maps can have a maximum length of 500 bytes/characters. |
static void |
stopTimedEvent(java.lang.String name)
Stop a previously started timed event.
|
static void |
stopTimedEvent(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> data)
Stop a previously started timed event, with extra data.
|
public static final java.lang.String VERSION
public static final java.lang.String COPYRIGHT
public static void onStart(android.content.Context context, java.lang.String apiKey)
Activity
's onStart()
method, that uses
AskingPoint services.onStop
.context
- The activities Android.contextapiKey
- This App's AskingPoint App Key App Keys can be found on the AskingPoint Dashboard on each Apps Settings tab.AskingPoint.onStop(android.content.Context)
public static void registerGCMSenderIDs(android.content.Context context, java.lang.String... senderIds)
<meta-data android:name="com.askingpoint.android.gcm.sender_id" android:value="@string/askp_gcm_sender_id"/>Then add the following string to your res/values/strings.xml, replacing YOUR_SENDER_ID with your sender ID:
<string name="askp_gcm_sender_id">YOUR_SENDER_ID</string>
public static void onStop(android.content.Context context)
onStart
as stopped.onStart
.context
- The activities Android.contextAskingPoint.onStart(android.content.Context, String)
public static void setOnCommandListener(AskingPoint.OnCommandListener onCommandListener)
Command
when Commands fire. Subsequent calls to this method in other
Activities, or in the same one will overwrite and replace the existing listener.public static void setOnCommandResponseListener(AskingPoint.OnCommandResponseListener onCommandResponseListener)
Command.complete(com.askingpoint.android.Command.Response)
when any Command has completed.public static void setOnUnreadFeedbackCountChangeListener(AskingPoint.OnUnreadFeedbackCountChangeListener onUnreadFeedbackCountChangeListener)
public static void addEvent(java.lang.String name)
name
- Name of the custom event. Max Length: 200 characters.public static void addEvent(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> data)
name
- Name of the custom event.data
- Data to associate with the event. Types allowed in the Map object are: java.lang.String, java.lang.Number,
android.location.Location. Anything else will be stringified and truncated to 500 characters.public static void startTimedEvent(java.lang.String name)
AskingPoint.stopTimedEvent(String)
or AskingPoint.stopTimedEvent(String, java.util.Map)
.name
- Name of the timed event.AskingPoint.stopTimedEvent(String)
,
AskingPoint.stopTimedEvent(String, java.util.Map)
,
SDK Help Topic: Timing Usagepublic static void startTimedEvent(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> data)
AskingPoint.stopTimedEvent(String)
or AskingPoint.stopTimedEvent(String, java.util.Map)
.name
- Name of the timed event.data
- Data to associate with the event. Types allowed in the Map object are: java.lang.String, java.lang.Number,
android.location.Location. Anything else will be stringified and truncated to 500 characters.AskingPoint.stopTimedEvent(String)
,
AskingPoint.stopTimedEvent(String, java.util.Map)
,
SDK Help Topic: Timing Usagepublic static void stopTimedEvent(java.lang.String name)
name
- Name of the timed event to stop.AskingPoint.startTimedEvent(String)
,
AskingPoint.startTimedEvent(String, java.util.Map)
,
SDK Help Topic: Timing Usagepublic static void stopTimedEvent(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> data)
name
- Name of the timed event to stop.data
- Data to associate with the event. Types allowed in the Map object are: java.lang.String, java.lang.Number,
android.location.Location. Anything else will be stringified and truncated to 500 characters.AskingPoint.startTimedEvent(String)
,
AskingPoint.startTimedEvent(String, java.util.Map)
,
SDK Help Topic: Timing Usagepublic static void requestCommandsWithTag(android.content.Context context, java.lang.String tag)
AskingPoint.OnCommandListener
, will be given the chance to customize or override the default presentation.public static void requestCommandsWithTag(android.content.Context context, java.lang.String tag, AskingPoint.OnTagCommandListener listener)
listener
will be called in all cases
when the request is complete. If no commands were found, a null will be passed for the command parameter.listener
returns false, the global
AskingPoint.OnCommandListener
will be called.public static void flush()
public static void setGender(java.lang.String gender)
public static void setAge(int age)
public static void setEmail(java.lang.String email)
public static void setUserName(java.lang.String userName)
public static void setUserID(java.lang.String userID)
public static void setOptedOut(boolean optedOut)
public static boolean isOptedOut()
public static void setApplicationName(java.lang.CharSequence applicationName)
public static java.lang.CharSequence getApplicationName()
public static void setApplicationVersion(java.lang.String applicationVersion)
public static java.lang.String getApplicationVersion()
public static long getUnreadFeedbackCount()
public static boolean canShowRatingPrompt(android.content.Context context)
showRatingPrompt
is currently available.
There is a very short period of time when Apps first launch where AskingPoint servers update the App with your Custom prompts or our default prompts for a devices language.public static boolean showRatingPrompt(android.content.Context context)
public static void setAppStoreRatingIntent(android.content.Intent appStoreRatingIntent)
public static android.content.Intent getAppStoreRatingIntent()
AskingPoint.setAppStoreRatingIntent(Intent)
. Returns null when the default is being used.public static void showCustomerSupport(android.app.Activity parentActivity)