-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 2.3.0 #20
Open
rlepinski
wants to merge
3
commits into
main
Choose a base branch
from
release-2.3.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Release 2.3.0 #20
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
package com.airship.capacitor | ||
|
||
object AirshipCapacitorVersion { | ||
var version = "2.2.0" | ||
var version = "2.3.0" | ||
} |
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 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 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 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 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
69 changes: 69 additions & 0 deletions
69
example/android/app/src/main/java/com/example/plugin/AirshipExtender.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package com.example.plugin | ||
|
||
import android.app.NotificationChannel | ||
import android.app.NotificationManager | ||
import android.app.PendingIntent | ||
import android.content.Context | ||
import android.content.Intent | ||
import android.os.Build | ||
import androidx.annotation.Keep | ||
import androidx.core.app.NotificationCompat | ||
import androidx.core.app.NotificationManagerCompat | ||
import com.urbanairship.UAirship | ||
import com.urbanairship.android.framework.proxy.AirshipPluginExtender | ||
import com.urbanairship.json.requireField | ||
import com.urbanairship.liveupdate.LiveUpdate | ||
import com.urbanairship.liveupdate.LiveUpdateEvent | ||
import com.urbanairship.liveupdate.LiveUpdateManager | ||
import com.urbanairship.liveupdate.LiveUpdateResult | ||
import com.urbanairship.liveupdate.SuspendLiveUpdateNotificationHandler | ||
|
||
|
||
@Keep | ||
public final class AirshipExtender: AirshipPluginExtender { | ||
override fun onAirshipReady(context: Context, airship: UAirship) { | ||
LiveUpdateManager.shared().register("Example", ExampleLiveUpdateHandler()) | ||
} | ||
} | ||
|
||
public final class ExampleLiveUpdateHandler: SuspendLiveUpdateNotificationHandler() { | ||
override suspend fun onUpdate( | ||
context: Context, | ||
event: LiveUpdateEvent, | ||
update: LiveUpdate | ||
): LiveUpdateResult<NotificationCompat.Builder> { | ||
|
||
if (event == LiveUpdateEvent.END) { | ||
// Dismiss the live update on END. The default behavior will leave the Live Update | ||
// in the notification tray until the dismissal time is reached or the user dismisses it. | ||
return LiveUpdateResult.cancel() | ||
} | ||
|
||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
val importance = NotificationManager.IMPORTANCE_DEFAULT | ||
val channel = NotificationChannel("emoji-example", "Emoji example", importance) | ||
channel.description = "Emoji example" | ||
NotificationManagerCompat.from(context).createNotificationChannel(channel) | ||
} | ||
|
||
val launchIntent = context.packageManager | ||
.getLaunchIntentForPackage(context.packageName) | ||
?.addCategory(update.name) | ||
?.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP) | ||
?.setPackage(null) | ||
|
||
val contentIntent = PendingIntent.getActivity( | ||
context, 0, launchIntent, PendingIntent.FLAG_IMMUTABLE | ||
) | ||
|
||
val notification = NotificationCompat.Builder(context, "emoji-example") | ||
.setSmallIcon(R.drawable.ic_notification) | ||
.setPriority(NotificationCompat.PRIORITY_MAX) | ||
.setCategory(NotificationCompat.CATEGORY_EVENT) | ||
.setContentTitle("Example Live Update") | ||
.setContentText(update.content.requireField<String>("emoji")) | ||
.setContentIntent(contentIntent) | ||
|
||
return LiveUpdateResult.ok(notification) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
example/android/app/src/main/res/drawable-anydpi-v24/ic_notification.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24" | ||
android:tint="#FFFFFF"> | ||
<group android:scaleX="0.92" | ||
android:scaleY="0.92" | ||
android:translateX="0.96" | ||
android:translateY="0.96"> | ||
<path | ||
android:pathData="M17.6,11.48 L19.44,8.3a0.63,0.63 0,0 0,-1.09 -0.63l-1.88,3.24a11.43,11.43 0,0 0,-8.94 0L5.65,7.67a0.63,0.63 0,0 0,-1.09 0.63L6.4,11.48A10.81,10.81 0,0 0,1 20L23,20A10.81,10.81 0,0 0,17.6 11.48ZM7,17.25A1.25,1.25 0,1 1,8.25 16,1.25 1.25,0 0,1 7,17.25ZM17,17.25A1.25,1.25 0,1 1,18.25 16,1.25 1.25,0 0,1 17,17.25Z" | ||
android:fillColor="#FF000000"/> | ||
</group> | ||
</vector> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+508 Bytes
example/android/app/src/main/res/drawable-xhdpi/ic_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+769 Bytes
example/android/app/src/main/res/drawable-xxhdpi/ic_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing link here and on the next line. do we need to wait for a docs deploy before we can link these?