Skip to content

Commit

Permalink
Release v6.52.0
Browse files Browse the repository at this point in the history
  • Loading branch information
neerhaj committed Mar 28, 2022
1 parent d25f846 commit efd4e82
Show file tree
Hide file tree
Showing 10 changed files with 433 additions and 143 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ yarn.lock
android/.classpath/
android/.project/
android/.settings/
android/.classpath
android/.project
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Before installing the plugin, you must setup your app to receive push notificati
- [Generate Auth Key](https://docs.oracle.com/en/cloud/saas/marketing/responsys-develop-mobile/ios/auth-key/)
- Log in to the [Responsys Mobile App Developer Console](https://docs.oracle.com/en/cloud/saas/marketing/responsys-develop-mobile/dev-console/login/) and enter your Auth Key and other details for your iOS app.
- Download the `pushio_config.json` file generated from your credentials.
- ***Important:*** Copy `PushIOManager.framework` and place it in the plugin `YOUR_APP_DIR/ios/framework/` folder **before adding plugin to project**.
- ***Important:*** Copy `PushIOManager.framework` and place it in `YOUR_APP_DIR/ios/framework/` folder **before adding plugin to project**.


## Installation
Expand All @@ -73,7 +73,7 @@ yarn add @oracle/react-native-pushiomanager

```gradle
configurations.maybeCreate("default")
artifacts.add("default", file('PushIOManager-6.51.aar'))
artifacts.add("default", file('PushIOManager-6.52.aar'))
```

- Add the following to your project-wide `settings.gradle` file:
Expand Down
134 changes: 0 additions & 134 deletions android/android.iml

This file was deleted.

3 changes: 0 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ buildscript {
}
}

apply plugin: 'com.android.library'
apply plugin: 'maven'

android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
Expand Down
58 changes: 58 additions & 0 deletions android/src/main/java/com/pushio/manager/rn/RCTPushIOManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.pushio.manager.PIOMCMessageError;
import com.pushio.manager.PIOMCMessageListener;
import com.pushio.manager.PIOMCRichContentListener;
import com.pushio.manager.PIOMessageCenterUpdateListener;
import com.pushio.manager.PIORegionCompletionListener;
import com.pushio.manager.PIORegionEventType;
import com.pushio.manager.PIORegionException;
Expand Down Expand Up @@ -894,6 +895,15 @@ private void emitEvent(String eventName, WritableMap map) {
}
}

private void emitEvent(String eventName, WritableArray array) {
try {
getReactApplicationContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit(eventName, array);
} catch (Exception e) {
PIOLogger.v("RN eE " + e);
}
}

@ReactMethod
public void setNotificationSmallIconColor(String colorHex) {
if (!TextUtils.isEmpty(colorHex)) {
Expand All @@ -903,6 +913,24 @@ public void setNotificationSmallIconColor(String colorHex) {

}

@ReactMethod
public void setInAppMessageBannerHeight(int heightDP, final Callback callback) {
final boolean isBannerHeightSet = mPushIOManager.setInAppMessageBannerHeight(heightDP);

if (callback != null) {
callback.invoke(null, isBannerHeightSet);
}
}

@ReactMethod
public void getInAppMessageBannerHeight(final Callback callback) {
final int bannerHeight = mPushIOManager.getInAppMessageBannerHeight();

if (callback != null) {
callback.invoke(null, bannerHeight);
}
}

@ReactMethod
public void setNotificationSmallIcon(String resourceName) {
if (!TextUtils.isEmpty(resourceName)) {
Expand Down Expand Up @@ -939,4 +967,34 @@ public void setNotificationLargeIcon(String resourceName) {
}
}

@ReactMethod
public void setStatusBarHiddenForIAMBannerInterstitial(boolean hideStatusBar) {
mPushIOManager.setStatusBarHiddenForIAMBannerInterstitial(hideStatusBar);
}

@ReactMethod
public void isStatusBarHiddenForIAMBannerInterstitial(final Callback callback) {
final boolean isStatusBarHidden = mPushIOManager.isStatusBarHiddenForIAMBannerInterstitial();

if (callback != null) {
callback.invoke(null, isStatusBarHidden);
}
}

@ReactMethod
public void addMessageCenterUpdateListener(boolean executeRsysWebUrl) {

mPushIOManager.addMessageCenterUpdateListener(new PIOMessageCenterUpdateListener() {
@Override
public void onUpdate(List<String> messageCenters) {
WritableArray writableMessageCenters = new WritableNativeArray();

for (String messageCenter : messageCenters) {
writableMessageCenters.pushString(messageCenter);
}

emitEvent("PIOMessageCenterUpdateNotification", writableMessageCenters);
}
});
}
}
Loading

0 comments on commit efd4e82

Please sign in to comment.