Merge branch 'fdroid-build' of https://github.com/RocketChat/Rocket.Chat.ReactNative into official-build
This commit is contained in:
commit
b639db944f
|
@ -75,29 +75,6 @@ restore_cache: &restore-gradle-cache
|
|||
name: Restore gradle cache
|
||||
key: android-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }}
|
||||
|
||||
restore-brew-cache: &restore-brew-cache
|
||||
name: Restore Brew cache
|
||||
key: brew-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
|
||||
|
||||
save-brew-cache: &save-brew-cache
|
||||
name: Save brew cache
|
||||
key: brew-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
|
||||
paths:
|
||||
- /usr/local/Homebrew
|
||||
|
||||
install-apple-sim-utils: &install-apple-sim-utils
|
||||
name: Install appleSimUtils
|
||||
command: |
|
||||
brew update
|
||||
brew tap wix/brew
|
||||
brew install wix/brew/applesimutils
|
||||
|
||||
rebuild-detox: &rebuild-detox
|
||||
name: Rebuild Detox framework cache
|
||||
command: |
|
||||
npx detox clean-framework-cache
|
||||
npx detox build-framework-cache
|
||||
|
||||
version: 2.1
|
||||
|
||||
# EXECUTORS
|
||||
|
@ -107,39 +84,6 @@ executors:
|
|||
environment:
|
||||
<<: *bash-env
|
||||
|
||||
# COMMANDS
|
||||
commands:
|
||||
detox-test:
|
||||
parameters:
|
||||
folder:
|
||||
type: string
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
- attach_workspace:
|
||||
at: .
|
||||
|
||||
- restore_cache: *restore-npm-cache-mac
|
||||
|
||||
- restore_cache: *restore-brew-cache
|
||||
|
||||
- run: *install-node
|
||||
|
||||
- run: *install-apple-sim-utils
|
||||
|
||||
- run: *install-npm-modules
|
||||
|
||||
- run: *rebuild-detox
|
||||
|
||||
- run:
|
||||
name: Test
|
||||
command: |
|
||||
npx detox test << parameters.folder >> --configuration ios.sim.release --cleanup
|
||||
when: always
|
||||
|
||||
- store_artifacts:
|
||||
path: ./artifacts
|
||||
|
||||
# JOBS
|
||||
jobs:
|
||||
lint-testunit:
|
||||
|
@ -174,57 +118,6 @@ jobs:
|
|||
|
||||
- save_cache: *save-npm-cache-linux
|
||||
|
||||
# E2E
|
||||
e2e-build:
|
||||
executor: mac-env
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
- restore_cache: *restore-npm-cache-mac
|
||||
|
||||
- restore_cache: *restore-brew-cache
|
||||
|
||||
- run: *install-node
|
||||
|
||||
- run: *install-apple-sim-utils
|
||||
|
||||
- run: *install-npm-modules
|
||||
|
||||
- run: *rebuild-detox
|
||||
|
||||
- run:
|
||||
name: Build
|
||||
command: |
|
||||
npx detox build --configuration ios.sim.release
|
||||
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths:
|
||||
- ios/build/Build/Products/Release-iphonesimulator/RocketChatRN.app
|
||||
|
||||
- save_cache: *save-npm-cache-mac
|
||||
|
||||
- save_cache: *save-brew-cache
|
||||
|
||||
e2e-test-onboarding:
|
||||
executor: mac-env
|
||||
steps:
|
||||
- detox-test:
|
||||
folder: "./e2e/tests/onboarding"
|
||||
|
||||
e2e-test-room:
|
||||
executor: mac-env
|
||||
steps:
|
||||
- detox-test:
|
||||
folder: "./e2e/tests/room"
|
||||
|
||||
e2e-test-assorted:
|
||||
executor: mac-env
|
||||
steps:
|
||||
- detox-test:
|
||||
folder: "./e2e/tests/assorted"
|
||||
|
||||
# Android builds
|
||||
android-build:
|
||||
<<: *defaults
|
||||
|
@ -433,23 +326,6 @@ workflows:
|
|||
jobs:
|
||||
- lint-testunit
|
||||
|
||||
- e2e-hold:
|
||||
type: approval
|
||||
requires:
|
||||
- lint-testunit
|
||||
- e2e-build:
|
||||
requires:
|
||||
- e2e-hold
|
||||
- e2e-test-onboarding:
|
||||
requires:
|
||||
- e2e-build
|
||||
- e2e-test-room:
|
||||
requires:
|
||||
- e2e-build
|
||||
- e2e-test-assorted:
|
||||
requires:
|
||||
- e2e-build
|
||||
|
||||
- ios-build:
|
||||
requires:
|
||||
- lint-testunit
|
||||
|
|
|
@ -0,0 +1,221 @@
|
|||
name: iOS Detox
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
detox-build:
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_11.5.app
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Generate Detox app cache key
|
||||
run: echo $(git rev-parse HEAD:app) > "./app-git-revision.txt"
|
||||
|
||||
- name: Cache Detox app
|
||||
uses: actions/cache@v1
|
||||
id: detoxappcache
|
||||
with:
|
||||
path: ios/build/Build/Products/Release-iphonesimulator
|
||||
key: iOSDetoxRelease-v4-${{ hashFiles('yarn.lock') }}-${{ hashFiles('ios/Podfile.lock') }}-${{ hashFiles('./app-git-revision.txt') }}
|
||||
|
||||
- name: Node
|
||||
if: steps.detoxappcache.outputs.cache-hit != 'true'
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Cache node modules
|
||||
if: steps.detoxappcache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache@v1
|
||||
id: npmcache
|
||||
with:
|
||||
path: node_modules
|
||||
key: node-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Rebuild detox
|
||||
if: steps.detoxappcache.outputs.cache-hit != 'true' && steps.npmcache.outputs.cache-hit == 'true'
|
||||
run: yarn detox clean-framework-cache && yarn detox build-framework-cache
|
||||
|
||||
- name: Install Dependencies
|
||||
if: steps.detoxappcache.outputs.cache-hit != 'true' && steps.npmcache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
|
||||
- run: yarn detox build e2e --configuration ios.sim.release
|
||||
if: steps.detoxappcache.outputs.cache-hit != 'true'
|
||||
|
||||
detox-test-rooms:
|
||||
needs: detox-build
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_11.5.app
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Generate Detox app cache key
|
||||
run: echo $(git rev-parse HEAD:app) > "./app-git-revision.txt"
|
||||
|
||||
- name: Cache Detox app
|
||||
uses: actions/cache@v1
|
||||
id: detoxappcache
|
||||
with:
|
||||
path: ios/build/Build/Products/Release-iphonesimulator
|
||||
key: iOSDetoxRelease-v4-${{ hashFiles('yarn.lock') }}-${{ hashFiles('ios/Podfile.lock') }}-${{ hashFiles('./app-git-revision.txt') }}
|
||||
|
||||
- name: Check for Detox app
|
||||
if: steps.detoxappcache.outputs.cache-hit != 'true'
|
||||
run: exit 1
|
||||
|
||||
- name: Node
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v1
|
||||
id: npmcache
|
||||
with:
|
||||
path: node_modules
|
||||
key: node-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Rebuild detox
|
||||
if: steps.npmcache.outputs.cache-hit == 'true'
|
||||
run: yarn detox clean-framework-cache && yarn detox build-framework-cache
|
||||
|
||||
- name: Install Dependencies
|
||||
if: steps.npmcache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
|
||||
- run: brew tap wix/brew
|
||||
- run: brew install applesimutils
|
||||
- run: yarn detox test e2e/tests/room --configuration ios.sim.release --cleanup
|
||||
|
||||
- name: Upload test artifacts
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: artifacts
|
||||
path: artifacts
|
||||
|
||||
detox-test-assorted:
|
||||
needs: detox-build
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_11.5.app
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Generate Detox app cache key
|
||||
run: echo $(git rev-parse HEAD:app) > "./app-git-revision.txt"
|
||||
|
||||
- name: Cache Detox app
|
||||
uses: actions/cache@v1
|
||||
id: detoxappcache
|
||||
with:
|
||||
path: ios/build/Build/Products/Release-iphonesimulator
|
||||
key: iOSDetoxRelease-v4-${{ hashFiles('yarn.lock') }}-${{ hashFiles('ios/Podfile.lock') }}-${{ hashFiles('./app-git-revision.txt') }}
|
||||
|
||||
- name: Check for Detox app
|
||||
if: steps.detoxappcache.outputs.cache-hit != 'true'
|
||||
run: exit 1
|
||||
|
||||
- name: Node
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v1
|
||||
id: npmcache
|
||||
with:
|
||||
path: node_modules
|
||||
key: node-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Rebuild detox
|
||||
if: steps.npmcache.outputs.cache-hit == 'true'
|
||||
run: yarn detox clean-framework-cache && yarn detox build-framework-cache
|
||||
|
||||
- name: Install Dependencies
|
||||
if: steps.npmcache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
|
||||
- run: brew tap wix/brew
|
||||
- run: brew install applesimutils
|
||||
- run: yarn detox test e2e/tests/assorted --configuration ios.sim.release --cleanup
|
||||
|
||||
- name: Upload test artifacts
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: artifacts
|
||||
path: artifacts
|
||||
|
||||
detox-test-onboarding:
|
||||
needs: detox-build
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_11.5.app
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Generate Detox app cache key
|
||||
run: echo $(git rev-parse HEAD:app) > "./app-git-revision.txt"
|
||||
|
||||
- name: Cache Detox app
|
||||
uses: actions/cache@v1
|
||||
id: detoxappcache
|
||||
with:
|
||||
path: ios/build/Build/Products/Release-iphonesimulator
|
||||
key: iOSDetoxRelease-v4-${{ hashFiles('yarn.lock') }}-${{ hashFiles('ios/Podfile.lock') }}-${{ hashFiles('./app-git-revision.txt') }}
|
||||
|
||||
- name: Check for Detox app
|
||||
if: steps.detoxappcache.outputs.cache-hit != 'true'
|
||||
run: exit 1
|
||||
|
||||
- name: Node
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v1
|
||||
id: npmcache
|
||||
with:
|
||||
path: node_modules
|
||||
key: node-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Rebuild detox
|
||||
if: steps.npmcache.outputs.cache-hit == 'true'
|
||||
run: yarn detox clean-framework-cache && yarn detox build-framework-cache
|
||||
|
||||
- name: Install Dependencies
|
||||
if: steps.npmcache.outputs.cache-hit != 'true'
|
||||
run: yarn install
|
||||
|
||||
- run: brew tap wix/brew
|
||||
- run: brew install applesimutils
|
||||
- run: yarn detox test e2e/tests/onboarding --configuration ios.sim.release --cleanup
|
||||
|
||||
- name: Upload test artifacts
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: artifacts
|
||||
path: artifacts
|
|
@ -9,6 +9,8 @@ public class Ejson {
|
|||
String rid;
|
||||
String type;
|
||||
Sender sender;
|
||||
String messageId;
|
||||
String notificationType;
|
||||
|
||||
private String TOKEN_KEY = "reactnativemeteor_usertoken-";
|
||||
private SharedPreferences sharedPreferences = RNUserDefaultsModule.getPreferences(CustomPushNotification.reactApplicationContext);
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,10 @@
|
|||
package chat.rocket.reactnative;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class Callback {
|
||||
public void call(@Nullable Bundle bundle) {
|
||||
|
||||
}
|
||||
}
|
|
@ -14,8 +14,9 @@ import android.graphics.drawable.Icon;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.app.Person;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.gson.*;
|
||||
import com.google.gson.Gson;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
|
@ -33,15 +34,18 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
|
||||
import static com.wix.reactnativenotifications.Defs.NOTIFICATION_RECEIVED_EVENT_NAME;
|
||||
|
||||
public class CustomPushNotification extends PushNotification {
|
||||
public static ReactApplicationContext reactApplicationContext;
|
||||
final NotificationManager notificationManager;
|
||||
|
||||
public CustomPushNotification(Context context, Bundle bundle, AppLifecycleFacade appLifecycleFacade, AppLaunchHelper appLaunchHelper, JsIOHelper jsIoHelper) {
|
||||
super(context, bundle, appLifecycleFacade, appLaunchHelper, jsIoHelper);
|
||||
reactApplicationContext = new ReactApplicationContext(context);
|
||||
notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
}
|
||||
|
||||
private static Map<String, List<Bundle>> notificationMessages = new HashMap<String, List<Bundle>>();
|
||||
|
@ -54,29 +58,39 @@ public class CustomPushNotification extends PushNotification {
|
|||
|
||||
@Override
|
||||
public void onReceived() throws InvalidNotificationException {
|
||||
final Bundle bundle = mNotificationProps.asBundle();
|
||||
Bundle received = mNotificationProps.asBundle();
|
||||
Ejson receivedEjson = new Gson().fromJson(received.getString("ejson", "{}"), Ejson.class);
|
||||
|
||||
if (receivedEjson.notificationType != null && receivedEjson.notificationType.equals("message-id-only")) {
|
||||
notificationLoad(receivedEjson.serverURL(), receivedEjson.messageId, new Callback() {
|
||||
@Override
|
||||
public void call(@Nullable Bundle bundle) {
|
||||
if (bundle != null) {
|
||||
mNotificationProps = createProps(bundle);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// We should re-read these values since that can be changed by notificationLoad
|
||||
Bundle bundle = mNotificationProps.asBundle();
|
||||
Ejson loadedEjson = new Gson().fromJson(bundle.getString("ejson", "{}"), Ejson.class);
|
||||
String notId = bundle.getString("notId", "1");
|
||||
String title = bundle.getString("title");
|
||||
|
||||
if (notificationMessages.get(notId) == null) {
|
||||
notificationMessages.put(notId, new ArrayList<Bundle>());
|
||||
}
|
||||
|
||||
Gson gson = new Gson();
|
||||
Ejson ejson = gson.fromJson(bundle.getString("ejson", "{}"), Ejson.class);
|
||||
|
||||
boolean hasSender = ejson.sender != null;
|
||||
boolean hasSender = loadedEjson.sender != null;
|
||||
String title = bundle.getString("title");
|
||||
|
||||
bundle.putLong("time", new Date().getTime());
|
||||
bundle.putString("username", hasSender ? ejson.sender.username : title);
|
||||
bundle.putString("senderId", hasSender ? ejson.sender._id : "1");
|
||||
bundle.putString("avatarUri", ejson.getAvatarUri());
|
||||
bundle.putString("username", hasSender ? loadedEjson.sender.username : title);
|
||||
bundle.putString("senderId", hasSender ? loadedEjson.sender._id : "1");
|
||||
bundle.putString("avatarUri", loadedEjson.getAvatarUri());
|
||||
|
||||
notificationMessages.get(notId).add(bundle);
|
||||
|
||||
super.postNotification(Integer.parseInt(notId));
|
||||
|
||||
postNotification(Integer.parseInt(notId));
|
||||
notifyReceivedToJS();
|
||||
}
|
||||
|
||||
|
@ -96,6 +110,8 @@ public class CustomPushNotification extends PushNotification {
|
|||
String notId = bundle.getString("notId", "1");
|
||||
String title = bundle.getString("title");
|
||||
String message = bundle.getString("message");
|
||||
Boolean notificationLoaded = bundle.getBoolean("notificationLoaded", false);
|
||||
Ejson ejson = new Gson().fromJson(bundle.getString("ejson", "{}"), Ejson.class);
|
||||
|
||||
notification
|
||||
.setContentTitle(title)
|
||||
|
@ -109,10 +125,34 @@ public class CustomPushNotification extends PushNotification {
|
|||
notificationColor(notification);
|
||||
notificationChannel(notification);
|
||||
notificationIcons(notification, bundle);
|
||||
notificationStyle(notification, notificationId, bundle);
|
||||
notificationReply(notification, notificationId, bundle);
|
||||
notificationDismiss(notification, notificationId);
|
||||
|
||||
// if notificationType is null (RC < 3.5) or notificationType is different of message-id-only or notification was loaded successfully
|
||||
if (ejson.notificationType == null || !ejson.notificationType.equals("message-id-only") || notificationLoaded) {
|
||||
notificationStyle(notification, notificationId, bundle);
|
||||
notificationReply(notification, notificationId, bundle);
|
||||
|
||||
// message couldn't be loaded from server (Fallback notification)
|
||||
} else {
|
||||
Gson gson = new Gson();
|
||||
// iterate over the current notification ids to dismiss fallback notifications from same server
|
||||
for (Map.Entry<String, List<Bundle>> bundleList : notificationMessages.entrySet()) {
|
||||
// iterate over the notifications with this id (same host + rid)
|
||||
Iterator iterator = bundleList.getValue().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Bundle not = (Bundle) iterator.next();
|
||||
// get the notification info
|
||||
Ejson notEjson = gson.fromJson(not.getString("ejson", "{}"), Ejson.class);
|
||||
// if already has a notification from same server
|
||||
if (ejson.serverURL().equals(notEjson.serverURL())) {
|
||||
String id = not.getString("notId");
|
||||
// cancel this notification
|
||||
notificationManager.cancel(Integer.parseInt(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return notification;
|
||||
}
|
||||
|
||||
|
@ -296,8 +336,11 @@ public class CustomPushNotification extends PushNotification {
|
|||
intent.putExtra(NOTIFICATION_ID, notificationId);
|
||||
|
||||
PendingIntent dismissPendingIntent = PendingIntent.getBroadcast(mContext, notificationId, intent, 0);
|
||||
|
||||
|
||||
notification.setDeleteIntent(dismissPendingIntent);
|
||||
}
|
||||
|
||||
private void notificationLoad(String server, String messageId, Callback callback) {
|
||||
LoadNotification.load(reactApplicationContext, server, messageId, callback);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ public class Ejson {
|
|||
String rid;
|
||||
String type;
|
||||
Sender sender;
|
||||
String messageId;
|
||||
String notificationType;
|
||||
|
||||
private String TOKEN_KEY = "reactnativemeteor_usertoken-";
|
||||
private SharedPreferences sharedPreferences = RNUserDefaultsModule.getPreferences(CustomPushNotification.reactApplicationContext);
|
||||
|
@ -40,4 +42,4 @@ public class Ejson {
|
|||
String username;
|
||||
String _id;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
package chat.rocket.reactnative;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.Interceptor;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
|
||||
import chat.rocket.userdefaults.RNUserDefaultsModule;
|
||||
|
||||
class JsonResponse {
|
||||
Data data;
|
||||
|
||||
class Data {
|
||||
Notification notification;
|
||||
|
||||
class Notification {
|
||||
String notId;
|
||||
String title;
|
||||
String text;
|
||||
Payload payload;
|
||||
|
||||
class Payload {
|
||||
String host;
|
||||
String rid;
|
||||
String type;
|
||||
Sender sender;
|
||||
String messageId;
|
||||
String notificationType;
|
||||
|
||||
class Sender {
|
||||
String username;
|
||||
String _id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class LoadNotification {
|
||||
private static int RETRY_COUNT = 0;
|
||||
private static int[] TIMEOUT = new int[]{ 0, 1, 3, 5, 10 };
|
||||
private static String TOKEN_KEY = "reactnativemeteor_usertoken-";
|
||||
private static SharedPreferences sharedPreferences = RNUserDefaultsModule.getPreferences(CustomPushNotification.reactApplicationContext);
|
||||
|
||||
public static void load(ReactApplicationContext reactApplicationContext, final String host, final String msgId, Callback callback) {
|
||||
final OkHttpClient client = new OkHttpClient();
|
||||
HttpUrl.Builder url = HttpUrl.parse(host.concat("/api/v1/push.get")).newBuilder();
|
||||
|
||||
String userId = sharedPreferences.getString(TOKEN_KEY.concat(host), "");
|
||||
String token = sharedPreferences.getString(TOKEN_KEY.concat(userId), "");
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.header("x-user-id", userId)
|
||||
.header("x-auth-token", token)
|
||||
.url(url.addQueryParameter("id", msgId).build())
|
||||
.build();
|
||||
|
||||
runRequest(client, request, callback);
|
||||
}
|
||||
|
||||
private static void runRequest(OkHttpClient client, Request request, Callback callback) {
|
||||
try {
|
||||
Thread.sleep(TIMEOUT[RETRY_COUNT] * 1000);
|
||||
|
||||
Response response = client.newCall(request).execute();
|
||||
String body = response.body().string();
|
||||
if (!response.isSuccessful()) {
|
||||
throw new Exception("Error");
|
||||
}
|
||||
|
||||
Gson gson = new Gson();
|
||||
JsonResponse json = gson.fromJson(body, JsonResponse.class);
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("notId", json.data.notification.notId);
|
||||
bundle.putString("title", json.data.notification.title);
|
||||
bundle.putString("message", json.data.notification.text);
|
||||
bundle.putString("ejson", gson.toJson(json.data.notification.payload));
|
||||
bundle.putBoolean("notificationLoaded", true);
|
||||
|
||||
callback.call(bundle);
|
||||
|
||||
} catch (Exception e) {
|
||||
if (RETRY_COUNT <= TIMEOUT.length) {
|
||||
RETRY_COUNT++;
|
||||
runRequest(client, request, callback);
|
||||
} else {
|
||||
callback.call(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,7 +28,7 @@ export const CustomHeaderButtons = React.memo(props => (
|
|||
|
||||
export const DrawerButton = React.memo(({ navigation, testID, ...otherProps }) => (
|
||||
<CustomHeaderButtons left>
|
||||
<Item title='drawer' iconName='menu_hamburguer' onPress={navigation.toggleDrawer} testID={testID} {...otherProps} />
|
||||
<Item title='drawer' iconName='hamburguer' onPress={navigation.toggleDrawer} testID={testID} {...otherProps} />
|
||||
</CustomHeaderButtons>
|
||||
));
|
||||
|
||||
|
@ -36,7 +36,7 @@ export const CloseModalButton = React.memo(({
|
|||
navigation, testID, onPress = () => navigation.pop(), ...props
|
||||
}) => (
|
||||
<CustomHeaderButtons left>
|
||||
<Item title='close' iconName='Cross' onPress={onPress} testID={testID} {...props} />
|
||||
<Item title='close' iconName='close' onPress={onPress} testID={testID} {...props} />
|
||||
</CustomHeaderButtons>
|
||||
));
|
||||
|
||||
|
@ -44,14 +44,14 @@ export const CancelModalButton = React.memo(({ onPress, testID }) => (
|
|||
<CustomHeaderButtons left>
|
||||
{isIOS
|
||||
? <Item title={I18n.t('Cancel')} onPress={onPress} testID={testID} />
|
||||
: <Item title='close' iconName='Cross' onPress={onPress} testID={testID} />
|
||||
: <Item title='close' iconName='close' onPress={onPress} testID={testID} />
|
||||
}
|
||||
</CustomHeaderButtons>
|
||||
));
|
||||
|
||||
export const MoreButton = React.memo(({ onPress, testID }) => (
|
||||
<CustomHeaderButtons>
|
||||
<Item title='more' iconName='menu' onPress={onPress} testID={testID} />
|
||||
<Item title='more' iconName='kebab' onPress={onPress} testID={testID} />
|
||||
</CustomHeaderButtons>
|
||||
));
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ const NotifierComponent = React.memo(({
|
|||
hitSlop={BUTTON_HIT_SLOP}
|
||||
background={Touchable.SelectableBackgroundBorderless()}
|
||||
>
|
||||
<CustomIcon name='Cross' style={[styles.close, { color: themes[theme].titleText }]} size={20} />
|
||||
<CustomIcon name='close' style={[styles.close, { color: themes[theme].titleText }]} size={20} />
|
||||
</Touchable>
|
||||
</View>
|
||||
);
|
||||
|
|
|
@ -78,7 +78,7 @@ const HeaderFooter = React.memo(({ onReaction, theme }) => (
|
|||
style={[styles.headerItem, { backgroundColor: themes[theme].auxiliaryBackground }]}
|
||||
theme={theme}
|
||||
>
|
||||
<CustomIcon name='add-reaction' size={24} color={themes[theme].bodyText} />
|
||||
<CustomIcon name='reaction-add' size={24} color={themes[theme].bodyText} />
|
||||
</Button>
|
||||
));
|
||||
HeaderFooter.propTypes = {
|
||||
|
|
|
@ -32,7 +32,7 @@ const Item = ({ item, theme }) => {
|
|||
{ loading ? <ActivityIndicator theme={theme} /> : null }
|
||||
</FastImage>
|
||||
)
|
||||
: <CustomIcon name='clip' size={36} color={themes[theme].actionTintColor} />
|
||||
: <CustomIcon name='attach' size={36} color={themes[theme].actionTintColor} />
|
||||
}
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
|
|
@ -182,7 +182,7 @@ export default class RecordAudio extends React.PureComponent {
|
|||
accessibilityLabel={I18n.t('Send_audio_message')}
|
||||
accessibilityTraits='button'
|
||||
>
|
||||
<CustomIcon name='mic' size={23} color={themes[theme].tintColor} />
|
||||
<CustomIcon name='microphone' size={23} color={themes[theme].tintColor} />
|
||||
</BorderlessButton>
|
||||
);
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ export default class RecordAudio extends React.PureComponent {
|
|||
<CustomIcon
|
||||
size={22}
|
||||
color={themes[theme].dangerColor}
|
||||
name='Cross'
|
||||
name='close'
|
||||
/>
|
||||
</BorderlessButton>
|
||||
<Text
|
||||
|
|
|
@ -72,7 +72,7 @@ const ReplyPreview = React.memo(({
|
|||
theme={theme}
|
||||
/>
|
||||
</View>
|
||||
<CustomIcon name='Cross' color={themes[theme].auxiliaryText} size={20} style={styles.close} onPress={close} />
|
||||
<CustomIcon name='close' color={themes[theme].auxiliaryText} size={20} style={styles.close} onPress={close} />
|
||||
</View>
|
||||
);
|
||||
}, (prevProps, nextProps) => prevProps.replying === nextProps.replying && prevProps.theme === nextProps.theme && isEqual(prevProps.message, nextProps.message));
|
||||
|
|
|
@ -8,7 +8,7 @@ const ActionsButton = React.memo(({ theme, onPress }) => (
|
|||
onPress={onPress}
|
||||
testID='messagebox-actions'
|
||||
accessibilityLabel='Message_actions'
|
||||
icon='plus'
|
||||
icon='add'
|
||||
theme={theme}
|
||||
/>
|
||||
));
|
||||
|
|
|
@ -8,7 +8,7 @@ const CancelEditingButton = React.memo(({ theme, onPress }) => (
|
|||
onPress={onPress}
|
||||
testID='messagebox-cancel-editing'
|
||||
accessibilityLabel='Cancel_editing'
|
||||
icon='Cross'
|
||||
icon='close'
|
||||
theme={theme}
|
||||
/>
|
||||
));
|
||||
|
|
|
@ -8,7 +8,7 @@ const SendButton = React.memo(({ theme, onPress }) => (
|
|||
onPress={onPress}
|
||||
testID='messagebox-send-message'
|
||||
accessibilityLabel='Send_message'
|
||||
icon='send-active'
|
||||
icon='send-filled'
|
||||
theme={theme}
|
||||
/>
|
||||
));
|
||||
|
|
|
@ -134,7 +134,7 @@ class MessageBox extends Component {
|
|||
},
|
||||
{
|
||||
title: I18n.t('Take_a_video'),
|
||||
icon: 'video-1',
|
||||
icon: 'camera',
|
||||
onPress: this.takeVideo
|
||||
},
|
||||
{
|
||||
|
@ -144,12 +144,12 @@ class MessageBox extends Component {
|
|||
},
|
||||
{
|
||||
title: I18n.t('Choose_file'),
|
||||
icon: 'folder',
|
||||
icon: 'file',
|
||||
onPress: this.chooseFile
|
||||
},
|
||||
{
|
||||
title: I18n.t('Create_Discussion'),
|
||||
icon: 'chat',
|
||||
icon: 'discussions',
|
||||
onPress: this.createDiscussion
|
||||
}
|
||||
];
|
||||
|
|
|
@ -10,7 +10,7 @@ import { CustomIcon } from '../../../lib/Icons';
|
|||
const LockIcon = React.memo(({ theme }) => (
|
||||
<Row style={styles.row}>
|
||||
<View style={styles.iconView}>
|
||||
<CustomIcon name='lock' size={40} color={themes[theme].passcodeLockIcon} />
|
||||
<CustomIcon name='auth' size={40} color={themes[theme].passcodeLockIcon} />
|
||||
</View>
|
||||
</Row>
|
||||
));
|
||||
|
|
|
@ -104,7 +104,7 @@ const ModalContent = React.memo(({
|
|||
<View style={styles.titleContainer}>
|
||||
<CustomIcon
|
||||
style={[styles.closeButton, { color: themes[props.theme].buttonText }]}
|
||||
name='Cross'
|
||||
name='close'
|
||||
size={20}
|
||||
/>
|
||||
<Text style={[styles.title, { color: themes[props.theme].buttonText }]}>{I18n.t('Reactions')}</Text>
|
||||
|
|
|
@ -20,19 +20,19 @@ const RoomTypeIcon = React.memo(({
|
|||
|
||||
const color = themes[theme].auxiliaryText;
|
||||
|
||||
let icon = 'lock';
|
||||
let icon = 'channel-private';
|
||||
if (type === 'discussion') {
|
||||
icon = 'chat';
|
||||
icon = 'discussions';
|
||||
} else if (type === 'c') {
|
||||
icon = 'hash';
|
||||
icon = 'channel-public';
|
||||
} else if (type === 'd') {
|
||||
if (isGroupChat) {
|
||||
icon = 'team';
|
||||
} else {
|
||||
icon = 'at';
|
||||
icon = 'mention';
|
||||
}
|
||||
} else if (type === 'l') {
|
||||
icon = 'livechat';
|
||||
icon = 'omnichannel';
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -61,7 +61,7 @@ const SearchBox = ({
|
|||
]}
|
||||
>
|
||||
<View style={[styles.searchBox, { backgroundColor: themes[theme].searchboxBackground }]}>
|
||||
<CustomIcon name='magnifier' size={14} color={themes[theme].auxiliaryText} />
|
||||
<CustomIcon name='search' size={14} color={themes[theme].auxiliaryText} />
|
||||
<TextInput
|
||||
ref={inputRef}
|
||||
autoCapitalize='none'
|
||||
|
|
|
@ -111,7 +111,7 @@ export default class RCTextInput extends React.PureComponent {
|
|||
return (
|
||||
<BorderlessButton onPress={this.tooglePassword} style={[styles.iconContainer, styles.iconRight]}>
|
||||
<CustomIcon
|
||||
name={showPassword ? 'eye' : 'eye-off'}
|
||||
name={showPassword ? 'unread-on-top' : 'unread-on-top-disabled'}
|
||||
testID={testID ? `${ testID }-icon-right` : null}
|
||||
style={{ color: themes[theme].auxiliaryText }}
|
||||
size={20}
|
||||
|
|
|
@ -24,7 +24,7 @@ const Chip = ({
|
|||
<>
|
||||
{item.imageUrl ? <FastImage style={styles.chipImage} source={{ uri: item.imageUrl }} /> : null}
|
||||
<Text numberOfLines={1} style={[styles.chipText, { color: themes[theme].titleText }]}>{textParser([item.text])}</Text>
|
||||
<CustomIcon name='Cross' size={16} color={themes[theme].auxiliaryText} />
|
||||
<CustomIcon name='close' size={16} color={themes[theme].auxiliaryText} />
|
||||
</>
|
||||
</Touchable>
|
||||
);
|
||||
|
|
|
@ -82,7 +82,7 @@ export const Overflow = ({
|
|||
hitSlop={BUTTON_HIT_SLOP}
|
||||
style={styles.menu}
|
||||
>
|
||||
{!loading ? <CustomIcon size={18} name='menu' color={themes[theme].bodyText} /> : <ActivityIndicator style={styles.loading} theme={theme} />}
|
||||
{!loading ? <CustomIcon size={18} name='kebab' color={themes[theme].bodyText} /> : <ActivityIndicator style={styles.loading} theme={theme} />}
|
||||
</Touchable>
|
||||
<Popover
|
||||
isVisible={show}
|
||||
|
|
|
@ -79,7 +79,7 @@ const Button = React.memo(({
|
|||
{
|
||||
loading
|
||||
? <ActivityIndicator style={[styles.playPauseButton, styles.audioLoading]} theme={theme} />
|
||||
: <CustomIcon name={paused ? 'play' : 'pause'} size={36} color={themes[theme].tintColor} />
|
||||
: <CustomIcon name={paused ? 'play-filled' : 'pause-filled'} size={36} color={themes[theme].tintColor} />
|
||||
}
|
||||
</Touchable>
|
||||
));
|
||||
|
|
|
@ -26,7 +26,7 @@ const Broadcast = React.memo(({
|
|||
testID='message-broadcast-reply'
|
||||
>
|
||||
<>
|
||||
<CustomIcon name='back' size={20} style={styles.buttonIcon} color={themes[theme].buttonText} />
|
||||
<CustomIcon name='arrow-back' size={20} style={styles.buttonIcon} color={themes[theme].buttonText} />
|
||||
<Text style={[styles.buttonText, { color: themes[theme].buttonText }]}>{I18n.t('Reply')}</Text>
|
||||
</>
|
||||
</Touchable>
|
||||
|
|
|
@ -22,7 +22,7 @@ const CallButton = React.memo(({
|
|||
hitSlop={BUTTON_HIT_SLOP}
|
||||
>
|
||||
<>
|
||||
<CustomIcon name='video-1' size={20} style={styles.buttonIcon} color={themes[theme].buttonText} />
|
||||
<CustomIcon name='camera' size={20} style={styles.buttonIcon} color={themes[theme].buttonText} />
|
||||
<Text style={[styles.buttonText, { color: themes[theme].buttonText }]}>{I18n.t('Click_to_join')}</Text>
|
||||
</>
|
||||
</Touchable>
|
||||
|
|
|
@ -29,7 +29,7 @@ const Discussion = React.memo(({
|
|||
hitSlop={BUTTON_HIT_SLOP}
|
||||
>
|
||||
<>
|
||||
<CustomIcon name='chat' size={20} style={styles.buttonIcon} color={themes[theme].buttonText} />
|
||||
<CustomIcon name='discussions' size={20} style={styles.buttonIcon} color={themes[theme].buttonText} />
|
||||
<Text style={[styles.buttonText, { color: themes[theme].buttonText }]}>{buttonText}</Text>
|
||||
</>
|
||||
</Touchable>
|
||||
|
|
|
@ -23,7 +23,7 @@ const AddReaction = React.memo(({ theme }) => {
|
|||
hitSlop={BUTTON_HIT_SLOP}
|
||||
>
|
||||
<View style={[styles.reactionContainer, { borderColor: themes[theme].borderColor }]}>
|
||||
<CustomIcon name='add-reaction' size={21} color={themes[theme].tintColor} />
|
||||
<CustomIcon name='reaction-add' size={21} color={themes[theme].tintColor} />
|
||||
</View>
|
||||
</Touchable>
|
||||
);
|
||||
|
|
|
@ -49,7 +49,7 @@ const Video = React.memo(({
|
|||
background={Touchable.Ripple(themes[theme].bannerBackground)}
|
||||
>
|
||||
<CustomIcon
|
||||
name='play'
|
||||
name='play-filled'
|
||||
size={54}
|
||||
color={themes[theme].buttonText}
|
||||
/>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -107,7 +107,7 @@ export const RightActions = React.memo(({
|
|||
>
|
||||
<RectButton style={[styles.actionButton, { backgroundColor: themes[theme].hideBackground }]} onPress={onHidePress}>
|
||||
<>
|
||||
<CustomIcon size={20} name='eye-off' color={themes[theme].buttonText} />
|
||||
<CustomIcon size={20} name='unread-on-top-disabled' color={themes[theme].buttonText} />
|
||||
<Text style={[styles.actionText, { color: themes[theme].buttonText }]}>{I18n.t('Hide')}</Text>
|
||||
</>
|
||||
</RectButton>
|
||||
|
|
|
@ -83,7 +83,7 @@ const ChangePasscodeView = React.memo(({ theme }) => {
|
|||
{!data?.force
|
||||
? (
|
||||
<Touchable onPress={onCancel} style={styles.close}>
|
||||
<CustomIcon name='Cross' color={themes[theme].passcodePrimary} size={30} />
|
||||
<CustomIcon name='close' color={themes[theme].passcodePrimary} size={30} />
|
||||
</Touchable>
|
||||
)
|
||||
: null}
|
||||
|
|
|
@ -61,7 +61,7 @@ export default class DirectoryOptions extends PureComponent {
|
|||
let icon = 'user';
|
||||
if (itemType === 'channels') {
|
||||
text = 'Channels';
|
||||
icon = 'hash';
|
||||
icon = 'channel-public';
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -166,7 +166,7 @@ class DirectoryView extends React.Component {
|
|||
theme={theme}
|
||||
>
|
||||
<View style={[sharedStyles.separatorVertical, styles.toggleDropdownContainer, { borderColor: themes[theme].separatorColor }]}>
|
||||
<CustomIcon style={[styles.toggleDropdownIcon, { color: themes[theme].tintColor }]} size={20} name={type === 'users' ? 'user' : 'hash'} />
|
||||
<CustomIcon style={[styles.toggleDropdownIcon, { color: themes[theme].tintColor }]} size={20} name={type === 'users' ? 'user' : 'channel-public'} />
|
||||
<Text style={[styles.toggleDropdownText, { color: themes[theme].tintColor }]}>{type === 'users' ? I18n.t('Users') : I18n.t('Channels')}</Text>
|
||||
<CustomIcon name='chevron-down' size={20} style={[styles.toggleDropdownArrow, { color: themes[theme].auxiliaryTintColor }]} />
|
||||
</View>
|
||||
|
|
|
@ -218,7 +218,7 @@ const LivechatEditView = ({
|
|||
<TextInput
|
||||
inputRef={(e) => { inputs.tags = e; }}
|
||||
label={I18n.t('Tags')}
|
||||
iconRight='plus'
|
||||
iconRight='add'
|
||||
onIconRightPress={() => {
|
||||
const lastText = inputs.tags._lastNativeText || '';
|
||||
if (lastText.length) {
|
||||
|
|
|
@ -186,7 +186,7 @@ class NewMessageView extends React.Component {
|
|||
{this.renderButton({
|
||||
onPress: this.createChannel,
|
||||
title: I18n.t('Create_Channel'),
|
||||
icon: 'hash',
|
||||
icon: 'channel-public',
|
||||
testID: 'new-message-view-create-channel',
|
||||
first: true
|
||||
})}
|
||||
|
@ -199,7 +199,7 @@ class NewMessageView extends React.Component {
|
|||
{this.renderButton({
|
||||
onPress: this.createDiscussion,
|
||||
title: I18n.t('Create_Discussion'),
|
||||
icon: 'chat',
|
||||
icon: 'discussions',
|
||||
testID: 'new-message-view-create-discussion'
|
||||
})}
|
||||
</View>
|
||||
|
|
|
@ -229,7 +229,7 @@ class RoomActionsView extends React.Component {
|
|||
const isGroupChat = RocketChat.isGroupChat(room);
|
||||
|
||||
const notificationsAction = {
|
||||
icon: 'bell',
|
||||
icon: 'notification',
|
||||
name: I18n.t('Notifications'),
|
||||
route: 'NotificationPrefView',
|
||||
params: { rid, room },
|
||||
|
@ -238,13 +238,13 @@ class RoomActionsView extends React.Component {
|
|||
|
||||
const jitsiActions = jitsiEnabled ? [
|
||||
{
|
||||
icon: 'mic',
|
||||
icon: 'phone',
|
||||
name: I18n.t('Voice_call'),
|
||||
event: () => RocketChat.callJitsi(rid, true),
|
||||
testID: 'room-actions-voice'
|
||||
},
|
||||
{
|
||||
icon: 'video-1',
|
||||
icon: 'camera', // TODO: change me
|
||||
name: I18n.t('Video_call'),
|
||||
event: () => RocketChat.callJitsi(rid),
|
||||
testID: 'room-actions-video'
|
||||
|
@ -270,14 +270,14 @@ class RoomActionsView extends React.Component {
|
|||
}, {
|
||||
data: [
|
||||
{
|
||||
icon: 'clip',
|
||||
icon: 'attach',
|
||||
name: I18n.t('Files'),
|
||||
route: 'MessagesView',
|
||||
params: { rid, t, name: 'Files' },
|
||||
testID: 'room-actions-files'
|
||||
},
|
||||
{
|
||||
icon: 'at',
|
||||
icon: 'mention',
|
||||
name: I18n.t('Mentions'),
|
||||
route: 'MessagesView',
|
||||
params: { rid, t, name: 'Mentions' },
|
||||
|
@ -291,7 +291,7 @@ class RoomActionsView extends React.Component {
|
|||
testID: 'room-actions-starred'
|
||||
},
|
||||
{
|
||||
icon: 'magnifier',
|
||||
icon: 'search',
|
||||
name: I18n.t('Search'),
|
||||
route: 'SearchMessagesView',
|
||||
params: { rid },
|
||||
|
@ -365,7 +365,7 @@ class RoomActionsView extends React.Component {
|
|||
|
||||
if (canAddUser) {
|
||||
actions.push({
|
||||
icon: 'plus',
|
||||
icon: 'add',
|
||||
name: I18n.t('Add_users'),
|
||||
route: 'SelectedUsersView',
|
||||
params: {
|
||||
|
@ -378,7 +378,7 @@ class RoomActionsView extends React.Component {
|
|||
}
|
||||
if (canInviteUser) {
|
||||
actions.push({
|
||||
icon: 'add-user',
|
||||
icon: 'user-add',
|
||||
name: I18n.t('Invite_users'),
|
||||
route: 'InviteUsersView',
|
||||
params: {
|
||||
|
@ -394,7 +394,7 @@ class RoomActionsView extends React.Component {
|
|||
sections.push({
|
||||
data: [
|
||||
{
|
||||
icon: 'exit',
|
||||
icon: 'logout',
|
||||
name: I18n.t('Leave_channel'),
|
||||
type: 'danger',
|
||||
event: this.leaveChannel,
|
||||
|
@ -408,14 +408,14 @@ class RoomActionsView extends React.Component {
|
|||
sections[2].data = [];
|
||||
|
||||
sections[2].data.push({
|
||||
icon: 'cancel',
|
||||
icon: 'close',
|
||||
name: I18n.t('Close'),
|
||||
event: this.closeLivechat
|
||||
});
|
||||
|
||||
if (canForwardGuest) {
|
||||
sections[2].data.push({
|
||||
icon: 'transfer',
|
||||
icon: 'user-forward',
|
||||
name: I18n.t('Forward'),
|
||||
route: 'ForwardLivechatView',
|
||||
params: { rid }
|
||||
|
|
|
@ -35,7 +35,7 @@ const Banner = React.memo(({
|
|||
<BorderlessButton onPress={closeBanner}>
|
||||
<CustomIcon
|
||||
color={themes[theme].auxiliaryText}
|
||||
name='Cross'
|
||||
name='close'
|
||||
size={20}
|
||||
/>
|
||||
</BorderlessButton>
|
||||
|
|
|
@ -36,17 +36,17 @@ const Icon = React.memo(({
|
|||
|
||||
let icon;
|
||||
if (type === 'discussion') {
|
||||
icon = 'chat';
|
||||
icon = 'discussions';
|
||||
} else if (type === 'thread') {
|
||||
icon = 'threads';
|
||||
} else if (type === 'c') {
|
||||
icon = 'hash';
|
||||
icon = 'channel-public';
|
||||
} else if (type === 'l') {
|
||||
icon = 'livechat';
|
||||
icon = 'omnichannel';
|
||||
} else if (type === 'd') {
|
||||
icon = 'team';
|
||||
} else {
|
||||
icon = 'lock';
|
||||
icon = 'channel-private';
|
||||
}
|
||||
return (
|
||||
<CustomIcon
|
||||
|
|
|
@ -98,7 +98,7 @@ class RightButtonsContainer extends React.PureComponent {
|
|||
<CustomHeaderButtons>
|
||||
<Item
|
||||
title='bell'
|
||||
iconName={isFollowingThread ? 'bell' : 'bell-off'}
|
||||
iconName={isFollowingThread ? 'notification' : 'notification-disabled'}
|
||||
onPress={this.toggleFollowThread}
|
||||
testID={isFollowingThread ? 'room-view-header-unfollow' : 'room-view-header-follow'}
|
||||
/>
|
||||
|
@ -117,7 +117,7 @@ class RightButtonsContainer extends React.PureComponent {
|
|||
) : null}
|
||||
<Item
|
||||
title='search'
|
||||
iconName='magnifier'
|
||||
iconName='search'
|
||||
onPress={this.goSearchView}
|
||||
testID='room-view-search'
|
||||
/>
|
||||
|
|
|
@ -172,11 +172,11 @@ class UploadProgress extends Component {
|
|||
return (
|
||||
[
|
||||
<View key='row' style={styles.row}>
|
||||
<CustomIcon name='clip' size={20} color={themes[theme].auxiliaryText} />
|
||||
<CustomIcon name='attach' size={20} color={themes[theme].auxiliaryText} />
|
||||
<Text style={[styles.descriptionContainer, styles.descriptionText, { color: themes[theme].auxiliaryText }]} numberOfLines={1}>
|
||||
{I18n.t('Uploading')} {item.name}
|
||||
</Text>
|
||||
<CustomIcon name='Cross' size={20} color={themes[theme].auxiliaryText} onPress={() => this.cancelUpload(item)} />
|
||||
<CustomIcon name='close' size={20} color={themes[theme].auxiliaryText} onPress={() => this.cancelUpload(item)} />
|
||||
</View>,
|
||||
<View key='progress' style={[styles.progress, { width: (width * item.progress) / 100, backgroundColor: themes[theme].tintColor }]} />
|
||||
]
|
||||
|
@ -191,7 +191,7 @@ class UploadProgress extends Component {
|
|||
<Text style={[styles.tryAgainButtonText, { color: themes[theme].tintColor }]}>{I18n.t('Try_again')}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<CustomIcon name='Cross' size={20} color={themes[theme].auxiliaryText} onPress={() => this.deleteUpload(item)} />
|
||||
<CustomIcon name='close' size={20} color={themes[theme].auxiliaryText} onPress={() => this.deleteUpload(item)} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -190,7 +190,7 @@ class Sort extends PureComponent {
|
|||
</SortItemButton>
|
||||
<SortItemButton onPress={this.toggleUnread} theme={theme}>
|
||||
<SortItemContent
|
||||
icon='eye-off'
|
||||
icon='unread-on-top-disabled'
|
||||
label='Unread_on_top'
|
||||
checked={showUnread}
|
||||
theme={theme}
|
||||
|
|
|
@ -334,7 +334,7 @@ class RoomsListView extends React.Component {
|
|||
<CustomHeaderButtons left>
|
||||
<Item
|
||||
title='cancel'
|
||||
iconName='Cross'
|
||||
iconName='close'
|
||||
onPress={this.cancelSearch}
|
||||
/>
|
||||
</CustomHeaderButtons>
|
||||
|
@ -356,7 +356,7 @@ class RoomsListView extends React.Component {
|
|||
<CustomHeaderButtons>
|
||||
<Item
|
||||
title='new'
|
||||
iconName='new-chat'
|
||||
iconName='create'
|
||||
onPress={isMasterDetail
|
||||
? () => navigation.navigate('ModalStackNavigator', { screen: 'NewMessageView' })
|
||||
: () => navigation.navigate('NewMessageStackNavigator')}
|
||||
|
@ -364,7 +364,7 @@ class RoomsListView extends React.Component {
|
|||
/>
|
||||
<Item
|
||||
title='search'
|
||||
iconName='magnifier'
|
||||
iconName='search'
|
||||
onPress={this.initSearching}
|
||||
testID='rooms-list-view-search'
|
||||
/>
|
||||
|
|
|
@ -160,8 +160,16 @@ class SettingsView extends React.Component {
|
|||
}
|
||||
|
||||
shareApp = () => {
|
||||
// eslint-disable-next-line no-nested-ternary
|
||||
Share.share({ message: isAndroid ? (!isFDroidBuild ? PLAY_MARKET_LINK : FDROID_MARKET_LINK) : APP_STORE_LINK });
|
||||
let message;
|
||||
if (isAndroid) {
|
||||
message = PLAY_MARKET_LINK;
|
||||
if (isFDroidBuild) {
|
||||
message = FDROID_MARKET_LINK;
|
||||
}
|
||||
} else {
|
||||
message = APP_STORE_LINK;
|
||||
}
|
||||
Share.share({ message });
|
||||
}
|
||||
|
||||
copyServerVersion = () => {
|
||||
|
|
|
@ -154,7 +154,7 @@ class ShareListView extends React.Component {
|
|||
headerLeft: () => (searching
|
||||
? (
|
||||
<CustomHeaderButtons left>
|
||||
<Item title='cancel' iconName='Cross' onPress={this.cancelSearch} />
|
||||
<Item title='cancel' iconName='close' onPress={this.cancelSearch} />
|
||||
</CustomHeaderButtons>
|
||||
)
|
||||
: (
|
||||
|
|
|
@ -45,21 +45,21 @@ const Header = React.memo(({ room, thread, theme }) => {
|
|||
}
|
||||
let icon;
|
||||
if (type === 'discussion') {
|
||||
icon = 'chat';
|
||||
icon = 'discussions';
|
||||
} else if (type === 'thread') {
|
||||
icon = 'threads';
|
||||
} else if (type === 'c') {
|
||||
icon = 'hash';
|
||||
icon = 'channel-public';
|
||||
} else if (type === 'l') {
|
||||
icon = 'livechat';
|
||||
icon = 'omnichannel';
|
||||
} else if (type === 'd') {
|
||||
if (RocketChat.isGroupChat(room)) {
|
||||
icon = 'team';
|
||||
} else {
|
||||
icon = 'at';
|
||||
icon = 'mention';
|
||||
}
|
||||
} else {
|
||||
icon = 'lock';
|
||||
icon = 'channel-private';
|
||||
}
|
||||
|
||||
const textColor = themes[theme].previewTintColor;
|
||||
|
|
|
@ -96,7 +96,7 @@ const Preview = React.memo(({
|
|||
}
|
||||
return (
|
||||
<IconPreview
|
||||
iconName={type?.match(/image/) ? 'Camera' : 'clip'}
|
||||
iconName={type?.match(/image/) ? 'image' : 'attach'}
|
||||
title={item?.filename}
|
||||
description={prettyBytes(item?.size ?? 0)}
|
||||
theme={theme}
|
||||
|
|
|
@ -80,7 +80,7 @@ const ThumbContent = React.memo(({ item, theme, isShareExtension }) => {
|
|||
return (
|
||||
<View style={[styles.thumb, { borderColor: themes[theme].borderColor }]}>
|
||||
<CustomIcon
|
||||
name='Camera'
|
||||
name='image'
|
||||
size={30}
|
||||
color={themes[theme].tintColor}
|
||||
/>
|
||||
|
@ -95,7 +95,7 @@ const ThumbContent = React.memo(({ item, theme, isShareExtension }) => {
|
|||
<>
|
||||
<Image source={{ uri }} style={styles.thumb} />
|
||||
<CustomIcon
|
||||
name='video-1'
|
||||
name='camera-filled'
|
||||
size={20}
|
||||
color={themes[theme].buttonText}
|
||||
style={styles.videoThumbIcon}
|
||||
|
@ -127,7 +127,7 @@ const Thumb = ({
|
|||
>
|
||||
<View style={[styles.removeView, { borderColor: themes[theme].auxiliaryBackground }]}>
|
||||
<CustomIcon
|
||||
name='Cross'
|
||||
name='close'
|
||||
color={themes[theme].backgroundColor}
|
||||
size={14}
|
||||
/>
|
||||
|
|
|
@ -164,7 +164,7 @@ class Sidebar extends Component {
|
|||
<Separator theme={theme} />
|
||||
<SidebarItem
|
||||
text={I18n.t('Admin_Panel')}
|
||||
left={<CustomIcon name='shield' size={20} color={themes[theme].titleText} />}
|
||||
left={<CustomIcon name='settings' size={20} color={themes[theme].titleText} />}
|
||||
onPress={() => Navigation.navigate(routeName)}
|
||||
testID='sidebar-settings'
|
||||
current={this.currentItemKey === routeName}
|
||||
|
@ -193,7 +193,7 @@ class Sidebar extends Component {
|
|||
/>
|
||||
<SidebarItem
|
||||
text={I18n.t('Settings')}
|
||||
left={<CustomIcon name='cog' size={20} color={themes[theme].titleText} />}
|
||||
left={<CustomIcon name='administration' size={20} color={themes[theme].titleText} />}
|
||||
onPress={() => this.sidebarNavigate('SettingsStackNavigator')}
|
||||
testID='sidebar-settings'
|
||||
current={this.currentItemKey === 'SettingsStackNavigator'}
|
||||
|
|
|
@ -14,6 +14,7 @@ async function navigateToWorkspace() {
|
|||
}
|
||||
|
||||
async function navigateToLogin() {
|
||||
await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(20000);
|
||||
await navigateToWorkspace();
|
||||
await element(by.id('workspace-view-login')).tap();
|
||||
await waitFor(element(by.id('login-view'))).toBeVisible().withTimeout(2000);
|
||||
|
@ -21,6 +22,7 @@ async function navigateToLogin() {
|
|||
}
|
||||
|
||||
async function navigateToRegister() {
|
||||
await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(20000);
|
||||
await navigateToWorkspace();
|
||||
await element(by.id('workspace-view-register')).tap();
|
||||
await waitFor(element(by.id('register-view'))).toBeVisible().withTimeout(2000);
|
||||
|
|
|
@ -6,7 +6,7 @@ const data = require('../../data');
|
|||
describe('Onboarding', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(2000);
|
||||
await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(20000);
|
||||
});
|
||||
|
||||
describe('Render', () => {
|
||||
|
|
|
@ -30,14 +30,14 @@ describe('Create room screen', () => {
|
|||
|
||||
describe('Usage', async() => {
|
||||
it('should back to rooms list', async() => {
|
||||
await waitFor(element(by.id('new-message-view-close'))).toBeVisible().withTimeout(2000);
|
||||
await waitFor(element(by.id('new-message-view-close'))).toBeVisible().withTimeout(5000);
|
||||
await element(by.id('new-message-view-close')).tap();
|
||||
|
||||
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(2000);
|
||||
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(5000);
|
||||
|
||||
await tryTapping(element(by.id('rooms-list-view-create-channel')), 3000);
|
||||
//await element(by.id('rooms-list-view-create-channel')).tap();
|
||||
await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(5000);
|
||||
});
|
||||
|
||||
it('should search user and navigate', async() => {
|
||||
|
@ -47,14 +47,14 @@ describe('Create room screen', () => {
|
|||
await waitFor(element(by.id('room-view'))).toExist().withTimeout(10000);
|
||||
await waitFor(element(by.id('room-view-title-rocket.cat'))).toExist().withTimeout(60000);
|
||||
await tapBack();
|
||||
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(5000);
|
||||
});
|
||||
|
||||
it('should navigate to select users', async() => {
|
||||
await element(by.id('rooms-list-view-create-channel')).tap();
|
||||
await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(5000);
|
||||
await element(by.id('new-message-view-create-channel')).tap();
|
||||
await waitFor(element(by.id('select-users-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('select-users-view'))).toExist().withTimeout(5000);
|
||||
});
|
||||
})
|
||||
});
|
||||
|
@ -62,35 +62,31 @@ describe('Create room screen', () => {
|
|||
describe('Select Users', async() => {
|
||||
it('should search users', async() => {
|
||||
await element(by.id('select-users-view-search')).replaceText('rocket.cat');
|
||||
await waitFor(element(by.id(`select-users-view-item-rocket.cat`))).toExist().withTimeout(10000);
|
||||
await expect(element(by.id(`select-users-view-item-rocket.cat`))).toExist();
|
||||
await waitFor(element(by.id(`select-users-view-item-rocket.cat`))).toBeVisible().withTimeout(10000);
|
||||
});
|
||||
|
||||
it('should select/unselect user', async() => {
|
||||
await element(by.id('select-users-view-item-rocket.cat')).tap();
|
||||
await waitFor(element(by.id('selected-user-rocket.cat'))).toExist().withTimeout(5000);
|
||||
await expect(element(by.id('selected-user-rocket.cat'))).toExist();
|
||||
await waitFor(element(by.id('selected-user-rocket.cat'))).toBeVisible().withTimeout(10000);
|
||||
await element(by.id('selected-user-rocket.cat')).tap();
|
||||
await waitFor(element(by.id('selected-user-rocket.cat'))).toBeNotVisible().withTimeout(5000);
|
||||
await expect(element(by.id('selected-user-rocket.cat'))).toBeNotVisible();
|
||||
await waitFor(element(by.id('selected-user-rocket.cat'))).toBeNotVisible().withTimeout(10000);
|
||||
await element(by.id('select-users-view-item-rocket.cat')).tap();
|
||||
await waitFor(element(by.id('selected-user-rocket.cat'))).toExist().withTimeout(5000);
|
||||
await waitFor(element(by.id('selected-user-rocket.cat'))).toBeVisible().withTimeout(10000);
|
||||
});
|
||||
|
||||
it('should navigate to create channel view', async() => {
|
||||
await element(by.id('selected-users-view-submit')).tap();
|
||||
await waitFor(element(by.id('create-channel-view'))).toExist().withTimeout(5000);
|
||||
await expect(element(by.id('create-channel-view'))).toExist();
|
||||
await waitFor(element(by.id('create-channel-view'))).toExist().withTimeout(10000);
|
||||
});
|
||||
})
|
||||
|
||||
describe('Create Channel', async() => {
|
||||
describe('Render', async() => {
|
||||
it('should render all fields', async() => {
|
||||
await expect(element(by.id('create-channel-name'))).toExist();
|
||||
await expect(element(by.id('create-channel-type'))).toExist();
|
||||
await expect(element(by.id('create-channel-readonly'))).toExist();
|
||||
await expect(element(by.id('create-channel-broadcast'))).toExist();
|
||||
await expect(element(by.id('create-channel-name'))).toBeVisible();
|
||||
await expect(element(by.id('create-channel-type'))).toBeVisible();
|
||||
await expect(element(by.id('create-channel-readonly'))).toBeVisible();
|
||||
await expect(element(by.id('create-channel-broadcast'))).toBeVisible();
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -113,18 +109,18 @@ describe('Create room screen', () => {
|
|||
await waitFor(element(by.id(`room-view-title-${ room }`))).toExist().withTimeout(60000);
|
||||
await expect(element(by.id(`room-view-title-${ room }`))).toExist();
|
||||
await tapBack();
|
||||
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(10000);
|
||||
await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toExist().withTimeout(60000);
|
||||
await expect(element(by.id(`rooms-list-view-item-${ room }`))).toExist();
|
||||
});
|
||||
|
||||
it('should create private room', async() => {
|
||||
const room = `private${ data.random }`;
|
||||
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(5000);
|
||||
await element(by.id('rooms-list-view-create-channel')).tap();
|
||||
await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(5000);
|
||||
await element(by.id('new-message-view-create-channel')).tap();
|
||||
await waitFor(element(by.id('select-users-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('select-users-view'))).toExist().withTimeout(5000);
|
||||
await element(by.id('select-users-view-item-rocket.cat')).tap();
|
||||
await waitFor(element(by.id('selected-user-rocket.cat'))).toExist().withTimeout(5000);
|
||||
await element(by.id('selected-users-view-submit')).tap();
|
||||
|
@ -136,21 +132,21 @@ describe('Create room screen', () => {
|
|||
await waitFor(element(by.id(`room-view-title-${ room }`))).toExist().withTimeout(60000);
|
||||
await expect(element(by.id(`room-view-title-${ room }`))).toExist();
|
||||
await tapBack();
|
||||
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(5000);
|
||||
await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toExist().withTimeout(60000);
|
||||
await expect(element(by.id(`rooms-list-view-item-${ room }`))).toExist();
|
||||
});
|
||||
|
||||
it('should create empty room', async() => {
|
||||
const room = `empty${ data.random }`;
|
||||
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(10000);
|
||||
// await device.launchApp({ newInstance: true });
|
||||
await element(by.id('rooms-list-view-create-channel')).tap();
|
||||
await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(5000);
|
||||
await element(by.id('new-message-view-create-channel')).tap();
|
||||
await waitFor(element(by.id('select-users-view'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.id('select-users-view'))).toExist().withTimeout(5000);
|
||||
await element(by.id('selected-users-view-submit')).tap();
|
||||
await waitFor(element(by.id('create-channel-view'))).toExist().withTimeout(5000);
|
||||
await waitFor(element(by.id('create-channel-view'))).toExist().withTimeout(10000);
|
||||
await element(by.id('create-channel-name')).replaceText(room);
|
||||
await element(by.id('create-channel-submit')).tap();
|
||||
await waitFor(element(by.id('room-view'))).toExist().withTimeout(60000);
|
||||
|
|
|
@ -344,6 +344,7 @@ describe('Room actions screen', () => {
|
|||
it('should add user to the room', async() => {
|
||||
await waitFor(element(by.id('room-actions-add-user'))).toExist().withTimeout(4000);
|
||||
await element(by.id('room-actions-add-user')).tap();
|
||||
await waitFor(element(by.id('select-users-view-search'))).toExist().withTimeout(4000);
|
||||
await element(by.id('select-users-view-search')).tap();
|
||||
await element(by.id('select-users-view-search')).replaceText(user.username);
|
||||
await waitFor(element(by.id(`select-users-view-item-${ user.username }`))).toExist().withTimeout(10000);
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>AppGroup</key>
|
||||
<string>group.ios.chat.rocket</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>NotificationService</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.usernotifications.service</string>
|
||||
<key>NSExtensionPrincipalClass</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).NotificationService</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.ios.chat.rocket</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,154 @@
|
|||
import CoreLocation
|
||||
import UserNotifications
|
||||
|
||||
struct PushResponse: Decodable {
|
||||
let success: Bool
|
||||
let data: Data
|
||||
|
||||
struct Data: Decodable {
|
||||
let notification: Notification
|
||||
|
||||
struct Notification: Decodable {
|
||||
let notId: Int
|
||||
let title: String
|
||||
let text: String
|
||||
let payload: Payload
|
||||
|
||||
struct Payload: Decodable, Encodable {
|
||||
let host: String
|
||||
let rid: String?
|
||||
let type: String?
|
||||
let sender: Sender?
|
||||
let messageId: String
|
||||
let notificationType: String?
|
||||
let name: String?
|
||||
|
||||
struct Sender: Decodable, Encodable {
|
||||
let _id: String
|
||||
let username: String
|
||||
let name: String
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class NotificationService: UNNotificationServiceExtension {
|
||||
|
||||
var contentHandler: ((UNNotificationContent) -> Void)?
|
||||
var bestAttemptContent: UNMutableNotificationContent?
|
||||
|
||||
var retryCount = 0
|
||||
var retryTimeout = [1.0, 3.0, 5.0, 10.0]
|
||||
|
||||
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
|
||||
self.contentHandler = contentHandler
|
||||
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
|
||||
|
||||
if let bestAttemptContent = bestAttemptContent {
|
||||
let ejson = (bestAttemptContent.userInfo["ejson"] as? String ?? "").data(using: .utf8)!
|
||||
guard let data = try? (JSONDecoder().decode(PushResponse.Data.Notification.Payload.self, from: ejson)) else {
|
||||
return
|
||||
}
|
||||
|
||||
let notificationType = data.notificationType ?? ""
|
||||
|
||||
// If the notification have the content at her payload, show it
|
||||
if notificationType != "message-id-only" {
|
||||
contentHandler(bestAttemptContent)
|
||||
return
|
||||
}
|
||||
|
||||
let suiteName = Bundle.main.object(forInfoDictionaryKey: "AppGroup") as! String
|
||||
let userDefaults = UserDefaults(suiteName: suiteName)
|
||||
|
||||
var server = data.host
|
||||
if (server.last == "/") {
|
||||
server.removeLast()
|
||||
}
|
||||
let msgId = data.messageId
|
||||
|
||||
let userId = userDefaults?.string(forKey: "reactnativemeteor_usertoken-\(server)") ?? ""
|
||||
let token = userDefaults?.string(forKey: "reactnativemeteor_usertoken-\(userId)") ?? ""
|
||||
|
||||
if userId.isEmpty || token.isEmpty {
|
||||
contentHandler(bestAttemptContent)
|
||||
return
|
||||
}
|
||||
|
||||
var urlComponents = URLComponents(string: "\(server)/api/v1/push.get")!
|
||||
let queryItems = [URLQueryItem(name: "id", value: msgId)]
|
||||
urlComponents.queryItems = queryItems
|
||||
|
||||
var request = URLRequest(url: urlComponents.url!)
|
||||
request.httpMethod = "GET"
|
||||
request.addValue(userId, forHTTPHeaderField: "x-user-id")
|
||||
request.addValue(token, forHTTPHeaderField: "x-auth-token")
|
||||
|
||||
runRequest(request: request, bestAttemptContent: bestAttemptContent, contentHandler: contentHandler)
|
||||
}
|
||||
}
|
||||
|
||||
func runRequest(request: URLRequest, bestAttemptContent: UNMutableNotificationContent, contentHandler: @escaping (UNNotificationContent) -> Void) {
|
||||
let task = URLSession.shared.dataTask(with: request) {(data, response, error) in
|
||||
|
||||
func retryRequest() {
|
||||
// if we can try again
|
||||
if self.retryCount < self.retryTimeout.count {
|
||||
// Try again after X seconds
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + self.retryTimeout[self.retryCount], execute: {
|
||||
self.runRequest(request: request, bestAttemptContent: bestAttemptContent, contentHandler: contentHandler)
|
||||
self.retryCount += 1
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// If some error happened
|
||||
if error != nil {
|
||||
retryRequest()
|
||||
|
||||
// Check if the request did successfully
|
||||
} else if let response = response as? HTTPURLResponse {
|
||||
// if it not was successfully
|
||||
if response.statusCode != 200 {
|
||||
retryRequest()
|
||||
|
||||
// If the response status is 200
|
||||
} else {
|
||||
// Process data
|
||||
if let data = data {
|
||||
// Parse data of response
|
||||
let push = try? (JSONDecoder().decode(PushResponse.self, from: data))
|
||||
if let push = push {
|
||||
if push.success {
|
||||
bestAttemptContent.title = push.data.notification.title
|
||||
bestAttemptContent.body = push.data.notification.text
|
||||
|
||||
let payload = try? (JSONEncoder().encode(push.data.notification.payload))
|
||||
if let payload = payload {
|
||||
bestAttemptContent.userInfo["ejson"] = String(data: payload, encoding: .utf8) ?? "{}"
|
||||
}
|
||||
|
||||
// Show notification with the content modified
|
||||
contentHandler(bestAttemptContent)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
retryRequest()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task.resume()
|
||||
}
|
||||
|
||||
override func serviceExtensionTimeWillExpire() {
|
||||
// Called just before the extension will be terminated by the system.
|
||||
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
|
||||
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
|
||||
contentHandler(bestAttemptContent)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -12,8 +12,6 @@
|
|||
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
|
||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
||||
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
||||
1E0DBC59247D75C40086559B /* custom.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E0DBC58247D75C40086559B /* custom.ttf */; };
|
||||
1E0DBC5A247D75C40086559B /* custom.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E0DBC58247D75C40086559B /* custom.ttf */; };
|
||||
1E1EA80A2326CD2200E22452 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E1EA8092326CD2200E22452 /* AVFoundation.framework */; };
|
||||
1E1EA80C2326CD2800E22452 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E1EA80B2326CD2800E22452 /* AudioToolbox.framework */; };
|
||||
1E1EA80E2326CD2F00E22452 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E1EA80D2326CD2F00E22452 /* CoreGraphics.framework */; };
|
||||
|
@ -30,10 +28,14 @@
|
|||
1EC6ACF622CBA01500A41C61 /* ShareRocketChatRN.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EC6ACF522CBA01500A41C61 /* ShareRocketChatRN.m */; };
|
||||
1ED59D4C22CBA77D00C54289 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1ED59D4B22CBA77D00C54289 /* GoogleService-Info.plist */; };
|
||||
1EDDE57A22DFAD8E0078F69D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1EDDE57922DFAD8E0078F69D /* Images.xcassets */; };
|
||||
1EFEB5982493B6640072EDC0 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EFEB5972493B6640072EDC0 /* NotificationService.swift */; };
|
||||
1EFEB59C2493B6640072EDC0 /* NotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 1EFEB5952493B6640072EDC0 /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
24A2AEF2383D44B586D31C01 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 06BB44DD4855498082A744AD /* libz.tbd */; };
|
||||
50046CB6BDA69B9232CF66D9 /* libPods-RocketChatRN.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C235DC7B31A4D1578EDEF219 /* libPods-RocketChatRN.a */; };
|
||||
7A006F14229C83B600803143 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A006F13229C83B600803143 /* GoogleService-Info.plist */; };
|
||||
7A0D62D2242AB187006D5C06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7A0D62D1242AB187006D5C06 /* LaunchScreen.storyboard */; };
|
||||
7A63763324C6104F00557D60 /* custom.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7A63763224C6104F00557D60 /* custom.ttf */; };
|
||||
7A63763424C6104F00557D60 /* custom.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7A63763224C6104F00557D60 /* custom.ttf */; };
|
||||
7AAA749E23043B1E00F1ADE9 /* Watermelon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AAA749D23043B1E00F1ADE9 /* Watermelon.swift */; };
|
||||
7AC99C1C2339361F0000A0CB /* Watermelon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AAA749D23043B1E00F1ADE9 /* Watermelon.swift */; };
|
||||
7ACD4897222860DE00442C55 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7ACD4853222860DE00442C55 /* JavaScriptCore.framework */; };
|
||||
|
@ -48,6 +50,13 @@
|
|||
remoteGlobalIDString = 1EC6ACAF22CB9FC300A41C61;
|
||||
remoteInfo = ShareRocketChatRN;
|
||||
};
|
||||
1EFEB59A2493B6640072EDC0 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 1EFEB5942493B6640072EDC0;
|
||||
remoteInfo = NotificationService;
|
||||
};
|
||||
7AAA749A23043AD300F1ADE9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 290E43E48AD8418287FA99D6 /* WatermelonDB.xcodeproj */;
|
||||
|
@ -65,6 +74,7 @@
|
|||
dstSubfolderSpec = 13;
|
||||
files = (
|
||||
1EC6ACBB22CB9FC300A41C61 /* ShareRocketChatRN.appex in Embed App Extensions */,
|
||||
1EFEB59C2493B6640072EDC0 /* NotificationService.appex in Embed App Extensions */,
|
||||
);
|
||||
name = "Embed App Extensions";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -82,7 +92,6 @@
|
|||
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RocketChatRN/Images.xcassets; sourceTree = "<group>"; };
|
||||
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RocketChatRN/Info.plist; sourceTree = "<group>"; };
|
||||
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RocketChatRN/main.m; sourceTree = "<group>"; };
|
||||
1E0DBC58247D75C40086559B /* custom.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = custom.ttf; sourceTree = "<group>"; };
|
||||
1E1EA8092326CD2200E22452 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
||||
1E1EA80B2326CD2800E22452 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
|
||||
1E1EA80D2326CD2F00E22452 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
|
@ -99,11 +108,16 @@
|
|||
1EC6AD6022CBA20C00A41C61 /* ShareRocketChatRN.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ShareRocketChatRN.entitlements; sourceTree = "<group>"; };
|
||||
1ED59D4B22CBA77D00C54289 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = SOURCE_ROOT; };
|
||||
1EDDE57922DFAD8E0078F69D /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
1EFEB5952493B6640072EDC0 /* NotificationService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = NotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1EFEB5972493B6640072EDC0 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
|
||||
1EFEB5992493B6640072EDC0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
1EFEB5A12493B67D0072EDC0 /* NotificationService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NotificationService.entitlements; sourceTree = "<group>"; };
|
||||
290E43E48AD8418287FA99D6 /* WatermelonDB.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = WatermelonDB.xcodeproj; path = "../node_modules/@nozbe/watermelondb/native/ios/WatermelonDB.xcodeproj"; sourceTree = "<group>"; };
|
||||
60B2A6A31FC4588700BD58E5 /* RocketChatRN.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = RocketChatRN.entitlements; path = RocketChatRN/RocketChatRN.entitlements; sourceTree = "<group>"; };
|
||||
66D6B1D0567051BE541450C9 /* Pods-RocketChatRN.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RocketChatRN.release.xcconfig"; path = "Pods/Target Support Files/Pods-RocketChatRN/Pods-RocketChatRN.release.xcconfig"; sourceTree = "<group>"; };
|
||||
7A006F13229C83B600803143 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
|
||||
7A0D62D1242AB187006D5C06 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
7A63763224C6104F00557D60 /* custom.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = custom.ttf; sourceTree = "<group>"; };
|
||||
7AAA749C23043B1D00F1ADE9 /* RocketChatRN-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RocketChatRN-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
7AAA749D23043B1E00F1ADE9 /* Watermelon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Watermelon.swift; sourceTree = "<group>"; };
|
||||
7ACD4853222860DE00442C55 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
|
||||
|
@ -146,6 +160,13 @@
|
|||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
1EFEB5922493B6640072EDC0 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
|
@ -180,6 +201,16 @@
|
|||
path = ShareRocketChatRN;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1EFEB5962493B6640072EDC0 /* NotificationService */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1EFEB5A12493B67D0072EDC0 /* NotificationService.entitlements */,
|
||||
1EFEB5972493B6640072EDC0 /* NotificationService.swift */,
|
||||
1EFEB5992493B6640072EDC0 /* Info.plist */,
|
||||
);
|
||||
path = NotificationService;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
22CA7F59107E0C79C2506C7C /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -213,6 +244,7 @@
|
|||
13B07FAE1A68108700A75B9A /* RocketChatRN */,
|
||||
832341AE1AAA6A7D00B99B32 /* Libraries */,
|
||||
1EC6ACB122CB9FC300A41C61 /* ShareRocketChatRN */,
|
||||
1EFEB5962493B6640072EDC0 /* NotificationService */,
|
||||
83CBBA001A601CBA00E9B192 /* Products */,
|
||||
BB4B591B5FC44CD9986DB2A6 /* Frameworks */,
|
||||
AF5E16F0398347E6A80C8CBE /* Resources */,
|
||||
|
@ -228,6 +260,7 @@
|
|||
children = (
|
||||
13B07F961A680F5B00A75B9A /* RocketChatRN.app */,
|
||||
1EC6ACB022CB9FC300A41C61 /* ShareRocketChatRN.appex */,
|
||||
1EFEB5952493B6640072EDC0 /* NotificationService.appex */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
|
@ -235,7 +268,7 @@
|
|||
AF5E16F0398347E6A80C8CBE /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1E0DBC58247D75C40086559B /* custom.ttf */,
|
||||
7A63763224C6104F00557D60 /* custom.ttf */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
|
@ -293,6 +326,7 @@
|
|||
);
|
||||
dependencies = (
|
||||
1EC6ACBA22CB9FC300A41C61 /* PBXTargetDependency */,
|
||||
1EFEB59B2493B6640072EDC0 /* PBXTargetDependency */,
|
||||
);
|
||||
name = RocketChatRN;
|
||||
productName = "Hello World";
|
||||
|
@ -321,6 +355,23 @@
|
|||
productReference = 1EC6ACB022CB9FC300A41C61 /* ShareRocketChatRN.appex */;
|
||||
productType = "com.apple.product-type.app-extension";
|
||||
};
|
||||
1EFEB5942493B6640072EDC0 /* NotificationService */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1EFEB5A02493B6640072EDC0 /* Build configuration list for PBXNativeTarget "NotificationService" */;
|
||||
buildPhases = (
|
||||
1EFEB5912493B6640072EDC0 /* Sources */,
|
||||
1EFEB5922493B6640072EDC0 /* Frameworks */,
|
||||
1EFEB5932493B6640072EDC0 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = NotificationService;
|
||||
productName = NotificationService;
|
||||
productReference = 1EFEB5952493B6640072EDC0 /* NotificationService.appex */;
|
||||
productType = "com.apple.product-type.app-extension";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
|
@ -328,6 +379,7 @@
|
|||
isa = PBXProject;
|
||||
attributes = {
|
||||
DefaultBuildSystemTypeForWorkspace = Original;
|
||||
LastSwiftUpdateCheck = 1150;
|
||||
LastUpgradeCheck = 1130;
|
||||
ORGANIZATIONNAME = Facebook;
|
||||
TargetAttributes = {
|
||||
|
@ -360,6 +412,11 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
1EFEB5942493B6640072EDC0 = {
|
||||
CreatedOnToolsVersion = 11.5;
|
||||
DevelopmentTeam = S6UPZG7ZR3;
|
||||
ProvisioningStyle = Manual;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RocketChatRN" */;
|
||||
|
@ -384,6 +441,7 @@
|
|||
targets = (
|
||||
13B07F861A680F5B00A75B9A /* RocketChatRN */,
|
||||
1EC6ACAF22CB9FC300A41C61 /* ShareRocketChatRN */,
|
||||
1EFEB5942493B6640072EDC0 /* NotificationService */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
@ -404,7 +462,7 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
||||
1E0DBC59247D75C40086559B /* custom.ttf in Resources */,
|
||||
7A63763324C6104F00557D60 /* custom.ttf in Resources */,
|
||||
7A006F14229C83B600803143 /* GoogleService-Info.plist in Resources */,
|
||||
7A0D62D2242AB187006D5C06 /* LaunchScreen.storyboard in Resources */,
|
||||
);
|
||||
|
@ -415,12 +473,19 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1EDDE57A22DFAD8E0078F69D /* Images.xcassets in Resources */,
|
||||
1E0DBC5A247D75C40086559B /* custom.ttf in Resources */,
|
||||
7A63763424C6104F00557D60 /* custom.ttf in Resources */,
|
||||
1EC6ACB722CB9FC300A41C61 /* MainInterface.storyboard in Resources */,
|
||||
1ED59D4C22CBA77D00C54289 /* GoogleService-Info.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
1EFEB5932493B6640072EDC0 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
|
@ -720,6 +785,14 @@
|
|||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
1EFEB5912493B6640072EDC0 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1EFEB5982493B6640072EDC0 /* NotificationService.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
|
@ -728,6 +801,11 @@
|
|||
target = 1EC6ACAF22CB9FC300A41C61 /* ShareRocketChatRN */;
|
||||
targetProxy = 1EC6ACB922CB9FC300A41C61 /* PBXContainerItemProxy */;
|
||||
};
|
||||
1EFEB59B2493B6640072EDC0 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 1EFEB5942493B6640072EDC0 /* NotificationService */;
|
||||
targetProxy = 1EFEB59A2493B6640072EDC0 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
|
@ -889,7 +967,7 @@
|
|||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/rn-extensions-share/ios/**",
|
||||
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/**",
|
||||
"$PODS_CONFIGURATION_BUILD_DIR/Firebase",
|
||||
$PODS_CONFIGURATION_BUILD_DIR/Firebase,
|
||||
);
|
||||
INFOPLIST_FILE = ShareRocketChatRN/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
|
@ -955,7 +1033,7 @@
|
|||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/rn-extensions-share/ios/**",
|
||||
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/**",
|
||||
"$PODS_CONFIGURATION_BUILD_DIR/Firebase",
|
||||
$PODS_CONFIGURATION_BUILD_DIR/Firebase,
|
||||
);
|
||||
INFOPLIST_FILE = ShareRocketChatRN/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
|
@ -978,6 +1056,68 @@
|
|||
};
|
||||
name = Release;
|
||||
};
|
||||
1EFEB59D2493B6640072EDC0 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements;
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = S6UPZG7ZR3;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = NotificationService/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
|
||||
MARKETING_VERSION = 4.10.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.reactnative.NotificationService;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "chat.rocket.reactnative.NotificationService Development";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1EFEB59E2493B6640072EDC0 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_TEAM = S6UPZG7ZR3;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = NotificationService/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
|
||||
MARKETING_VERSION = 4.10.0;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.reactnative.NotificationService;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "chat.rocket.reactnative.NotificationService AppStore";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
83CBBA201A601CBA00E9B192 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
|
@ -1101,6 +1241,15 @@
|
|||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1EFEB5A02493B6640072EDC0 /* Build configuration list for PBXNativeTarget "NotificationService" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1EFEB59D2493B6640072EDC0 /* Debug */,
|
||||
1EFEB59E2493B6640072EDC0 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RocketChatRN" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1150"
|
||||
wasCreatedForAppExtension = "YES"
|
||||
version = "2.0">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1EFEB5942493B6640072EDC0"
|
||||
BuildableName = "NotificationService.appex"
|
||||
BlueprintName = "NotificationService"
|
||||
ReferencedContainer = "container:RocketChatRN.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
||||
BuildableName = "RocketChatRN.app"
|
||||
BlueprintName = "RocketChatRN"
|
||||
ReferencedContainer = "container:RocketChatRN.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = ""
|
||||
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
|
||||
launchStyle = "0"
|
||||
askForAppToLaunch = "Yes"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES"
|
||||
launchAutomaticallySubstyle = "2">
|
||||
<RemoteRunnable
|
||||
runnableDebuggingMode = "1"
|
||||
BundleIdentifier = "com.apple.mobileslideshow"
|
||||
RemotePath = "/Applications/MobileSlideShow.app">
|
||||
</RemoteRunnable>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
||||
BuildableName = "RocketChatRN.app"
|
||||
BlueprintName = "RocketChatRN"
|
||||
ReferencedContainer = "container:RocketChatRN.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
launchAutomaticallySubstyle = "2">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
||||
BuildableName = "RocketChatRN.app"
|
||||
BlueprintName = "RocketChatRN"
|
||||
ReferencedContainer = "container:RocketChatRN.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
BIN
ios/custom.ttf
BIN
ios/custom.ttf
Binary file not shown.
|
@ -49,6 +49,7 @@ platform :ios do
|
|||
type: "appstore"
|
||||
) # more information: https://codesigning.guide
|
||||
get_provisioning_profile(app_identifier: "chat.rocket.reactnative.ShareExtension")
|
||||
get_provisioning_profile(app_identifier: "chat.rocket.reactnative.NotificationService")
|
||||
pem()
|
||||
gym(scheme: "RocketChatRN", workspace: "RocketChatRN.xcworkspace") # Build your app - more options available
|
||||
# frameit
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
"react-native-modal": "11.5.6",
|
||||
"react-native-navigation-bar-color": "2.0.1",
|
||||
"react-native-notifications": "2.1.7",
|
||||
"react-native-notifier": "^1.3.1",
|
||||
"react-native-notifier": "1.3.1",
|
||||
"react-native-orientation-locker": "1.1.8",
|
||||
"react-native-picker-select": "7.0.0",
|
||||
"react-native-platform-touchable": "^1.1.1",
|
||||
|
|
|
@ -104,6 +104,19 @@ index edc4fd4..7cd77f6 100644
|
|||
}
|
||||
|
||||
@end
|
||||
diff --git a/node_modules/react-native-notifications/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java b/node_modules/react-native-notifications/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java
|
||||
index 524ff07..70f22d5 100644
|
||||
--- a/node_modules/react-native-notifications/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java
|
||||
+++ b/node_modules/react-native-notifications/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java
|
||||
@@ -31,7 +31,7 @@ public class PushNotification implements IPushNotification {
|
||||
final protected AppLifecycleFacade mAppLifecycleFacade;
|
||||
final protected AppLaunchHelper mAppLaunchHelper;
|
||||
final protected JsIOHelper mJsIOHelper;
|
||||
- final protected PushNotificationProps mNotificationProps;
|
||||
+ protected PushNotificationProps mNotificationProps;
|
||||
final protected AppVisibilityListener mAppVisibilityListener = new AppVisibilityListener() {
|
||||
@Override
|
||||
public void onAppVisible() {
|
||||
diff --git a/node_modules/react-native-notifications/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java b/node_modules/react-native-notifications/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java
|
||||
index f9c858b..94ea188 100644
|
||||
--- a/node_modules/react-native-notifications/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java
|
||||
|
|
|
@ -12850,7 +12850,7 @@ react-native-notifications@2.1.7:
|
|||
core-js "^1.0.0"
|
||||
uuid "^2.0.3"
|
||||
|
||||
react-native-notifier@^1.3.1:
|
||||
react-native-notifier@1.3.1:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/react-native-notifier/-/react-native-notifier-1.3.1.tgz#a878c82c8ee99b04d57818401b1f084232729afd"
|
||||
integrity sha512-w7KOTF5WOYzbhCXQHz6p9tbosOVxhOW+Sh7VAdIuW6r7PSoryRNkF4P6Bzq1+2NPtMK7L6xnojCdKJ+nVnwh+A==
|
||||
|
|
Loading…
Reference in New Issue