Skip to content

Commit

Permalink
Merge pull request #16 from OFO-Mania/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Danang Galuh Tegar P authored Jul 27, 2020
2 parents da33367 + de2df2f commit b02eec9
Show file tree
Hide file tree
Showing 251 changed files with 7,634 additions and 3,366 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ buck-out/
# CocoaPods
/ios/Pods/
sentry.json
onesignal.json
20 changes: 0 additions & 20 deletions App.js

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# ofo-mobile
# OFO mobile

e-Wallet Application inspired by OVO, brought to mobile by OFO Mania
2 changes: 1 addition & 1 deletion __tests__/App-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'react-native';
import React from 'react';
import App from '../App';
import App from '../src/App';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
Expand Down
1 change: 1 addition & 0 deletions android/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
release
36 changes: 35 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
def getPassword(String currentUser, String keyChain) {
def stdout = new ByteArrayOutputStream()
def stderr = new ByteArrayOutputStream()
exec {
commandLine 'security', '-q', 'find-generic-password', '-a', currentUser, '-s', keyChain, '-w'
standardOutput = stdout
errorOutput = stderr
ignoreExitValue true
}
//noinspection GroovyAssignabilityCheck
stdout.toString().trim()
}

buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99]'
}
}

apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: "com.android.application"

import com.android.build.OutputFile
Expand Down Expand Up @@ -119,6 +142,7 @@ def jscFlavor = 'org.webkit:android-jsc:+'
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
def pass = getPassword("danang","android_keystore")

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand Down Expand Up @@ -150,6 +174,14 @@ android {
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword pass // Change this
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword pass // Change this
}
}
}
buildTypes {
debug {
Expand All @@ -158,7 +190,7 @@ android {
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
Expand All @@ -180,6 +212,8 @@ android {
}

dependencies {
implementation project(':react-native-onesignal')
implementation project(':react-native-vector-icons')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
Expand Down
6 changes: 5 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
package="xyz.ofomania.ofomobile">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application
android:name="xyz.ofomania.ofomobile.MainApplication"
Expand All @@ -14,7 +16,9 @@
android:name="xyz.ofomania.ofomobile.MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:launchMode="singleTop"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Binary file added android/app/src/main/assets/fonts/AntDesign.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/fonts/Entypo.ttf
Binary file not shown.
Binary file added android/app/src/main/assets/fonts/EvilIcons.ttf
Binary file not shown.
Binary file added android/app/src/main/assets/fonts/Feather.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/fonts/Fontisto.ttf
Binary file not shown.
Binary file added android/app/src/main/assets/fonts/Foundation.ttf
Binary file not shown.
Binary file added android/app/src/main/assets/fonts/Ionicons.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/fonts/Octicons.ttf
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/fonts/Zocial.ttf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.geektime.rnonesignalandroid.ReactNativeOneSignalPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

buildscript {
ext {
buildToolsVersion = "28.0.3"
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
Expand All @@ -12,7 +12,7 @@ buildscript {
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:3.5.2')
classpath('com.android.tools.build:gradle:4.0.1')

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
3 changes: 2 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Mon Jul 27 08:12:36 WIB 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
Empty file modified android/gradlew
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion android/sentry.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defaults.url=https://sentry.io/
defaults.org=danangid
defaults.project=ofo-mobile
auth.token=47091702ef724a269a823233c638c7c03c406ac04e9044f1acccbe83ad05837c
auth.token=41fe81170a864436a1e6320cbeca1d35cd891fe19f3b4f189d30ad752a96b269
cli.executable=node_modules/@sentry/cli/bin/sentry-cli
4 changes: 4 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
rootProject.name = 'OFO'
include ':react-native-onesignal'
project(':react-native-onesignal').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-onesignal/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import {AppRegistry} from 'react-native';
import App from './App';
import App from './src/App';
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => App);
33 changes: 33 additions & 0 deletions ios/OneSignalNotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
@@ -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>OneSignal_app_groups_key</key>
<string>group.xyz.ofomania.ofomobile.onesignal</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>OneSignalNotificationServiceExtension</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>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.usernotifications.service</string>
<key>NSExtensionPrincipalClass</key>
<string>NotificationService</string>
</dict>
</dict>
</plist>
13 changes: 13 additions & 0 deletions ios/OneSignalNotificationServiceExtension/NotificationService.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// NotificationService.h
// OneSignalNotificationServiceExtension
//
// Created by Danang Galuh Tegar Prasetyo on 21/11/19.
// Copyright © 2019 Facebook. All rights reserved.
//

#import <UserNotifications/UserNotifications.h>

@interface NotificationService : UNNotificationServiceExtension

@end
40 changes: 40 additions & 0 deletions ios/OneSignalNotificationServiceExtension/NotificationService.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#import <OneSignal/OneSignal.h>

#import "NotificationService.h"

@interface NotificationService ()

@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
@property (nonatomic, strong) UNNotificationRequest *receivedRequest;
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;

@end

@implementation NotificationService

- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
self.receivedRequest = request;
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];

[OneSignal didReceiveNotificationExtensionRequest:self.receivedRequest withMutableNotificationContent:self.bestAttemptContent];

// DEBUGGING: Uncomment the 2 lines below and comment out the one above to ensure this extension is excuting
// Note, this extension only runs when mutable-content is set
// Setting an attachment or action buttons automatically adds this
// NSLog(@"Running NotificationServiceExtension");
// self.bestAttemptContent.body = [@"[Modified] " stringByAppendingString:self.bestAttemptContent.body];

self.contentHandler(self.bestAttemptContent);
}

- (void)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.

[OneSignal serviceExtensionTimeWillExpireRequest:self.receivedRequest withMutableNotificationContent:self.bestAttemptContent];

self.contentHandler(self.bestAttemptContent);
}

@end
Original file line number Diff line number Diff line change
@@ -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.xyz.ofomania.ofomobile.onesignal</string>
</array>
</dict>
</plist>
16 changes: 16 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,26 @@ target 'ofo' do
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

pod 'react-native-onesignal', :path => '../node_modules/react-native-onesignal'

target 'ofoTests' do
inherit! :search_paths
# Pods for testing
end

target 'OneSignalNotificationServiceExtension' do
pod 'OneSignal', '>= 2.9.3', '< 3.0'
end

use_native_modules!
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
end
end
end
Loading

0 comments on commit b02eec9

Please sign in to comment.