This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Only for popups (FRIENDLY_POPUP or ANNOYING_POPUP) | |
//You MUST do this, otherwise popups will not work. | |
//Call it in the Activity you want to show the popup. | |
//You can show the popup in many screens by adding this in more than one Activity. | |
@Override | |
protected void onResume() { | |
super.onResume(); | |
PushLink.setCurrentActivity(this); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Changing default notification messages | |
StatusBarStrategy sbs = (StatusBarStrategy) PushLink.getCurrentStrategy(); | |
sbs.setStatusBarTitle("Hello, there is a new version"); | |
sbs.setStatusBarDescription("Click to be happy"); | |
//Changing strategy | |
PushLink.setCurrentStrategy(StrategyEnum.FRIENDLY_POPUP); | |
//Modifying new strategy | |
FriendlyPopUpStrategy fps = (FriendlyPopUpStrategy) PushLink.getCurrentStrategy(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PushLinkSetup extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
PushLink.start(this, R.drawable.icon, "yourApiKey"); | |
} | |
} | |
//Don't forget the AndroidManifest.xml <application android:name=".PushLinkSetup" ... > | |
//Parameters: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//When sending exception manually, PushLink doesn't print it in logcat. You have to print it by yourself. | |
try { | |
... | |
} catch (Throwable t) { | |
Log.e("MyApp", "Some", t); | |
PushLink.sendAsyncException(t); | |
//or | |
Map<String, String> moreInfo = ... | |
PushLink.sendAsyncException(t, moreInfo); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This information will be shown in two places: "Installations" and "Exceptions" tabs of the web administration | |
PushLink.addMetadata("Ip", getIp()); | |
PushLink.addMetadata("Phone Number", getPhoneNumber()); | |
PushLink.addMetadata("Brand", Build.BRAND); | |
PushLink.addMetadata("Model", Build.MODEL); | |
PushLink.addMetadata("OS Version", Build.VERSION.RELEASE); | |
PushLink.addMetadata("Logged in user", getUserName()); | |
... | |
//This information will be shown ONLY in the "Exceptions" tab of the web administration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This method checks if there is a downloaded but not applied update. It | |
* also notify the user again. It is useful for "Check for updates" | |
* button. | |
* | |
* @return true if there is a pending update | |
*/ | |
PushLink.hasPendingUpdate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PushLinkSetup extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
PushLink.start(this, R.drawable.icon, "yourApiKey", "yourDeviceID"); | |
} | |
} | |
//Don't forget the AndroidManifest.xml <application android:name=".PushLinkSetup" ... > | |
//Parameters: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//C# for MonoDroid | |
//place (side-by-side) PushLink jar and dll into the project | |
using Com.Pushlink.Android; | |
... | |
PushLink.Start(this, Resource.Drawable.Icon, "yourApiKey", "yourDeviceID"); |