Skip to content
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.2.0 #19

Merged
merged 4 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Capacitor Plugin Changelog

## Version 2.2.0 September 25, 2024
Minor release that updates the iOS SDK to 18.9.2 and adds the method `Airship.messageCenter.showMessageCenter(messageId?: string)` that can be used to show the OOTB Message Center UI even if auto launching Message Center is disabled. This new functionality is useful if the application needs to route the user in the app before processing the display event while still being able to use the OOTB UI.

### Changes
- Updated Airship iOS SDK to 18.9.2.
- Added new `showMessageCenter(messageId?: string)` to `MessageCenter`.

## Version 2.1.0 September 16, 2024
Minor release that adds `notificationPermissionStatus` to the `PushNotificationStatus` object and a way to specify the fallback when requesting permissions and the permission is already denied.

Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main"),
.package(url: "https://github.com/urbanairship/airship-mobile-framework-proxy.git", from: "8.0.0")
.package(url: "https://github.com/urbanairship/airship-mobile-framework-proxy.git", from: "8.1.0")
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion UaCapacitorAirship.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '14.0'
s.dependency 'Capacitor'
s.swift_version = '5.1'
s.dependency "AirshipFrameworkProxy", "8.0.0"
s.dependency "AirshipFrameworkProxy", "8.1.0"
s.default_subspecs = ["Bootloader", "Plugin"]


Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ext {
airshipProxyVersion = project.hasProperty('airshipProxyVersion') ? rootProject.ext.airshipProxyVersion : '8.0.0'
airshipProxyVersion = project.hasProperty('airshipProxyVersion') ? rootProject.ext.airshipProxyVersion : '8.1.0'
}


Expand Down
6 changes: 6 additions & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
android:label="@string/ua_message_center_title"
android:launchMode="singleTask"
android:exported="false">
<intent-filter>
<action android:name="com.urbanairship.VIEW_RICH_PUSH_INBOX" />
<data android:scheme="message" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<intent-filter>
<action android:name="com.urbanairship.VIEW_RICH_PUSH_INBOX" />
<category android:name="android.intent.category.DEFAULT" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package com.airship.capacitor

object AirshipCapacitorVersion {
var version = "2.0.1"
var version = "2.2.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ class AirshipPlugin : Plugin() {
"messageCenter#dismiss" -> call.resolveResult(method) { proxy.messageCenter.dismiss() }
"messageCenter#display" -> call.resolveResult(method) { proxy.messageCenter.display(arg.string) }
"messageCenter#showMessageView" -> call.resolveResult(method) { proxy.messageCenter.showMessageView(arg.requireString()) }
"messageCenter#showMessageCenter" -> call.resolveResult(method) { proxy.messageCenter.showMessageCenter(arg.string) }

"messageCenter#markMessageRead" -> call.resolveResult(method) { proxy.messageCenter.markMessageRead(arg.requireString()) }
"messageCenter#deleteMessage" -> call.resolveResult(method) { proxy.messageCenter.deleteMessage(arg.requireString()) }
"messageCenter#getUnreadMessageCount" -> call.resolveResult(method) { proxy.messageCenter.getUnreadMessagesCount() }
Expand Down
2 changes: 1 addition & 1 deletion ios/Plugin/AirshipCapacitorVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import Foundation

class AirshipCapacitorVersion {
static let version = "2.0.1"
static let version = "2.2.0"
}
6 changes: 6 additions & 0 deletions ios/Plugin/AirshipPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@ public class AirshipPlugin: CAPPlugin, CAPBridgedPlugin {
)
return nil

case "messageCenter#showMessageCenter":
try AirshipProxy.shared.messageCenter.showMessageCenter(
messageID: try? call.requireStringArg()
)
return nil

case "messageCenter#dismiss":
try AirshipProxy.shared.messageCenter.dismiss()
return nil
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def capacitor_pods
use_frameworks!
pod 'Capacitor', :path => '../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../node_modules/@capacitor/ios'
pod 'AirshipFrameworkProxy', '8.0.0'
pod 'AirshipFrameworkProxy', '8.1.0'
end

target 'Plugin' do
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ua/capacitor-airship",
"version": "2.1.0",
"version": "2.2.0",
"description": "Airship capacitor plugin",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down
10 changes: 10 additions & 0 deletions src/AirshipMessageCenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ export class AirshipMessageCenter {
return this.plugin.perform('messageCenter#showMessageView', messageId);
}

/**
* Overlays the message center regardless if auto launch Message Center is enabled or not.
*
* @param messageId Optional message Id.
* @returns A promise.
*/
public showMessageCenter(messageId?: string): Promise<void> {
return this.plugin.perform('messageCenter#showMessageCenter', messageId);
}

/**
* Refreshes the messages.
* @returns A promise. Will reject if the list fails to refresh or if
Expand Down