This file contains hidden or 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
//Don't forget to declare it in AndroidManifest.xml <application android:name=".PushLinkSetup" ... > | |
public class PushLinkSetup extends android.app.Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
PushLink.start(this, R.mipmap.ic_launcher, "yourApiKey", "yourDeviceID"); | |
//you can use R.drawable.icon for older sdks | |
} | |
} |
This file contains hidden or 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 | |
using Com.Pushlink.Android; | |
... | |
PushLink.Start(this, Resource.Drawable.Icon, "yourApiKey", "yourDeviceID"); |
This file contains hidden or 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
<repositories> | |
<repository> | |
<id>jitpack.io</id> | |
<url>https://jitpack.io</url> | |
</repository> | |
</repositories> | |
<dependency> | |
<groupId>com.pushlink</groupId> | |
<artifactId>pushlink-android</artifactId> |
This file contains hidden or 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
allprojects { | |
repositories { | |
... | |
maven { url "https://jitpack.io" } | |
} | |
} | |
dependencies { | |
implementation 'com.pushlink:pushlink-android:5.5.3' | |
} |
This file contains hidden or 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
registerReceiver(new BroadcastReceiver() { | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
Uri apkUri = (Uri) intent.getExtras().get("uri"); | |
//enjoy the apk uri | |
//notice this will be called every 30s (more or less). You need to handle this. | |
} | |
}, new IntentFilter(getPackageName() + ".pushlink.APPLY")); |
This file contains hidden or 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
<provider android:name="com.pushlink.android.FileProvider" android:authorities="your.package.name" android:exported="true" /> |
This file contains hidden or 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 new start API was introduced in pushlink-cordova-6.0.1 | |
var successCallback = function success() { console.log('PushLink started successfully'); }; | |
var errorCallback = function error() { console.log('An error occurred.'); }; | |
PushLink.start({ | |
apiKey: 'api-key', | |
deviceId: 'device-id', | |
successCallback: successCallback, | |
errorCallback: errorCallback |
This file contains hidden or 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
<uses-permission android:name="android.permission.INTERNET" /> |
This file contains hidden or 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 hidden or 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(); |
OlderNewer