Compare commits

...
12 Commits
Author SHA1 Message Date
Akinwale Ariwodola 032a1927db bumpversion 0.11.1 --> 0.12.0 2019-12-11 09:08:42 +01:00
Akinwale Ariwodola f24bf570ef app head: fixes before release 2019-12-11 09:08:26 +01:00
Akinwale Ariwodola 75c2ece016 add headers file to package (#792)
* latest headers
2019-12-11 08:46:34 +01:00
Akinwale Ariwodola 0c1c1a6c79 sdk 0.49.0 2019-12-10 16:30:18 +01:00
Akinwale Ariwodola 5af25a9d43 app head: update 2019-12-06 17:24:34 +01:00
Akinwale Ariwodola 55fec0f578 sdk 0.48.0 2019-12-05 13:42:42 +01:00
Akinwale Ariwodola b61fc3a148 Merge pull request #786 from lbryio/i18n
add language constant for app launch
2019-12-05 13:20:18 +01:00
Akinwale Ariwodola e3cd0fc2b1 add language constant for app launch 2019-12-05 13:19:22 +01:00
g1tman fe01f50c65 Perf: Use of sort and sorted functions optimized (#748)
* Update mixer.py
* Update graph.py
* Update mixer.py
* Update mixer.py
* Update bdistapk.py
* Update toolchain.py
* Update build.py
* Update build.py
2019-11-25 11:28:16 +01:00
Akinwale Ariwodola cd378d16e3 app head: fetching cost info fix 2019-11-12 21:10:57 +01:00
Akinwale Ariwodola e951fabf1c bumpversion 0.11.0 --> 0.11.1 2019-11-12 16:21:22 +01:00
Akinwale Ariwodola 48543a48fb log events for received and opened notifications (#760)
* log events for received and opened notifications
* app head: update to master
2019-11-12 15:50:47 +01:00
18 changed files with 183 additions and 29 deletions

No files matched your search

+1 -1
Submodule app updated: a127e14a0f...6ae9632fb9.
+1 -1
View File
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, "git+https://github.com/lbryio/lbry-sdk@v0.43.4#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.43.4#egg=torba&subdirectory=torba"
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, "git+https://github.com/lbryio/lbry-sdk@v0.49.0#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.49.0#egg=torba&subdirectory=torba"
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
+1 -1
View File
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, "git+https://github.com/lbryio/lbry-sdk@v0.43.4#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.43.4#egg=torba&subdirectory=torba"
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, "git+https://github.com/lbryio/lbry-sdk@v0.49.0#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.49.0#egg=torba&subdirectory=torba"
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
+1 -1
View File
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, "git+https://github.com/lbryio/lbry-sdk@v0.43.4#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.43.4#egg=torba&subdirectory=torba"
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, "git+https://github.com/lbryio/lbry-sdk@v0.49.0#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.49.0#egg=torba&subdirectory=torba"
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
+1 -1
View File
@@ -36,7 +36,7 @@ version.filename = %(source.dir)s/main.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, "git+https://github.com/lbryio/lbry-sdk@v0.43.4#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.43.4#egg=torba&subdirectory=torba"
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2018.11.29, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==10.4.0, defusedxml, git+https://github.com/lbryio/aioupnp.git@ab7ef0048bbce6404e463d20e8a15046ea6941f0#egg=aioupnp, asn1crypto, mock, netifaces, cryptography, aiohttp==3.5.4, multidict==4.5.2, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, "git+https://github.com/lbryio/lbry-sdk@v0.49.0#egg=lbry&subdirectory=lbry", "git+https://github.com/lbryio/lbry-sdk@v0.49.0#egg=torba&subdirectory=torba"
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
+2 -2
View File
@@ -123,7 +123,7 @@ class BdistAPK(Command):
exit(1)
if len(main_py_dirs) > 1:
print('WARNING: Multiple main.py dirs found, using the shortest path')
main_py_dirs = sorted(main_py_dirs, key=lambda j: len(split(j)))
main_py_dirs.sort(key=lambda j: len(split(j)))
if not argv_contains('--launcher'):
sys.argv.append('--private={}'.format(
@@ -145,4 +145,4 @@ def _set_user_options():
BdistAPK.user_options = user_options
_set_user_options()
_set_user_options()
@@ -447,8 +447,7 @@ main.py that loads it.''')
# Try to build with the newest available build tools
ignored = {".DS_Store", ".ds_store"}
build_tools_versions = [x for x in listdir(join(sdk_dir, 'build-tools')) if x not in ignored]
build_tools_versions = sorted(build_tools_versions,
key=LooseVersion)
build_tools_versions.sort(key=LooseVersion)
build_tools_version = build_tools_versions[-1]
# Folder name for launcher (used by SDL2 bootstrap)
@@ -344,8 +344,7 @@ main.py that loads it.''')
# Try to build with the newest available build tools
build_tools_versions = listdir(join(sdk_dir, 'build-tools'))
build_tools_versions = sorted(build_tools_versions,
key=LooseVersion)
build_tools_versions.sort(key=LooseVersion)
build_tools_version = build_tools_versions[-1]
+1 -2
View File
@@ -293,8 +293,7 @@ def get_recipe_order_and_bootstrap(ctx, names, bs=None, blacklist=None):
orders.append(list(order))
# prefer python3 and SDL2 if available
orders = sorted(orders,
key=lambda order: -('python3' in order) - ('sdl2' in order))
orders.sort(key=lambda order: -('python3' in order) - ('sdl2' in order))
if not orders:
raise BuildInterruptingException(
@@ -93,9 +93,7 @@ def find_channel(force=False):
if not force:
return None
busy.sort(key=lambda x: x.play_time)
return busy[0]
return min(busy, key=lambda x: x.play_time)
class ChannelImpl(object):
+1 -2
View File
@@ -822,8 +822,7 @@ class ToolchainCL(object):
build_tools_versions = os.listdir(join(ctx.sdk_dir,
'build-tools'))
build_tools_versions = sorted(build_tools_versions,
key=LooseVersion)
build_tools_versions.sort(key=LooseVersion)
build_tools_version = build_tools_versions[-1]
info(('Detected highest available build tools '
'version to be {}').format(build_tools_version))
+1 -3
View File
@@ -79,9 +79,7 @@ def find_channel(force=False):
if not force:
return None
busy.sort(key=lambda x : x.play_time)
return busy[0]
return min(busy, key=lambda x : x.play_time)
class ChannelImpl(object):
Binary file not shown.
@@ -9,10 +9,12 @@ import android.content.SharedPreferences;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
@@ -36,9 +38,14 @@ public class LbrynetMessagingService extends FirebaseMessagingService {
private static final String TYPE_CREATOR = "creator";
private FirebaseAnalytics firebaseAnalytics;
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.d(TAG, "From: " + remoteMessage.getFrom());
if (firebaseAnalytics == null) {
firebaseAnalytics = FirebaseAnalytics.getInstance(this);
}
Map<String, String> payload = remoteMessage.getData();
if (payload != null) {
@@ -46,9 +53,16 @@ public class LbrynetMessagingService extends FirebaseMessagingService {
String url = payload.get("target");
String title = payload.get("title");
String body = payload.get("body");
String name = payload.get("name"); // notification name
if (type != null && getEnabledTypes().indexOf(type) > -1 && body != null && body.trim().length() > 0) {
Log.d(TAG, "Message Notification Body: " + body);
sendNotification(title, body, type, url);
// only log the receive event for valid notifications received
if (firebaseAnalytics != null) {
Bundle bundle = new Bundle();
bundle.putString("name", name);
firebaseAnalytics.logEvent("lbry_notification_receive", bundle);
}
sendNotification(title, body, type, url, name);
}
}
}
@@ -80,7 +94,7 @@ public class LbrynetMessagingService extends FirebaseMessagingService {
*
* @param messageBody FCM message body received.
*/
private void sendNotification(String title, String messageBody, String type, String url) {
private void sendNotification(String title, String messageBody, String type, String url, String name) {
//Intent intent = new Intent(this, MainActivity.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (url == null) {
@@ -93,6 +107,7 @@ public class LbrynetMessagingService extends FirebaseMessagingService {
}
Intent launchIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
launchIntent.putExtra("notification_name", name);
launchIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, launchIntent, PendingIntent.FLAG_ONE_SHOT);
@@ -42,6 +42,7 @@ import com.facebook.react.modules.core.PermissionAwareActivity;
import com.facebook.react.modules.core.PermissionListener;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.react.ReactRootView;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.rnfs.RNFSPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
@@ -91,6 +92,8 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
private BroadcastReceiver downloadEventReceiver;
private FirebaseAnalytics firebaseAnalytics;
private ReactRootView mReactRootView;
private ReactInstanceManager mReactInstanceManager;
@@ -149,6 +152,8 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
ServiceHelper.start(this, "", LbrynetService.class, "lbrynetservice");
}
checkNotificationOpenIntent(getIntent());
mReactRootView = new RNGestureHandlerEnabledRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
@@ -174,6 +179,25 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
setContentView(mReactRootView);
}
private void checkNotificationOpenIntent(Intent intent) {
if (intent != null) {
String notificationName = intent.getStringExtra("notification_name");
if (notificationName != null) {
logNotificationOpen(notificationName);
}
}
}
private void logNotificationOpen(String name) {
if (firebaseAnalytics == null) {
firebaseAnalytics = FirebaseAnalytics.getInstance(this);
}
Bundle bundle = new Bundle();
bundle.putString("name", name);
firebaseAnalytics.logEvent("lbry_notification_open", bundle);
}
private void registerDownloadEventReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(DownloadManager.ACTION_DOWNLOAD_EVENT);
@@ -534,6 +558,8 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
notificationManager.cancel(sourceNotificationId);
}
checkNotificationOpenIntent(intent);
}
super.onNewIntent(intent);
@@ -2,8 +2,22 @@ package io.lbry.browser;
import android.content.Intent;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import java.io.Closeable;
import java.io.File;
import java.io.InputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class ServiceHelper {
private static final String TAG = "io.lbry.browser.ServiceHelper";
private static final String HEADERS_ASSET_KEY = "headersAssetInitialized";
public static Intent buildIntent(Context ctx, String pythonServiceArgument, Class serviceClass, String pythonName) {
Intent intent = new Intent(ctx, serviceClass);
String argument = ctx.getFilesDir().getAbsolutePath() + "/app";
@@ -18,13 +32,83 @@ public class ServiceHelper {
return intent;
}
public static void start(Context ctx, String pythonServiceArgument, Class serviceClass, String pythonName) {
Intent intent = buildIntent(ctx, pythonServiceArgument, serviceClass, pythonName);
ctx.startService(intent);
public static void start(final Context ctx, String pythonServiceArgument, Class serviceClass, String pythonName) {
// always check initial headers status before starting the service
final SharedPreferences sp = ctx.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
boolean initHeaders = sp.getBoolean(HEADERS_ASSET_KEY, false);
if (initHeaders) {
// initial headers asset copy already done. simply start the service
Intent intent = buildIntent(ctx, pythonServiceArgument, serviceClass, pythonName);
ctx.startService(intent);
return;
}
(new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
String targetPath = String.format("%s/lbryum/lbc_mainnet", Utils.getAppInternalStorageDir(ctx));
File targetDir = new File(targetPath);
if (!targetDir.exists()) {
targetDir.mkdirs();
}
String headersPath = String.format("%s/headers", targetPath);
android.util.Log.d(TAG, String.format("HeadersPath: %s", headersPath));
File targetHeadersFile = new File(headersPath);
InputStream in = null;
FileOutputStream out = null;
long sourceLen = 0;
long targetLen = 0;
try {
android.util.Log.d(TAG, "Opening asset: blockchain/headers");
in = ctx.getAssets().open("blockchain/headers");
out = new FileOutputStream(targetHeadersFile);
byte[] b = new byte[1120]; // 10 headers at a time?
int len;
while ((len = in.read(b, 0, 1120)) > 0) {
sourceLen += len;
out.write(b, 0, len);
}
} catch (Exception ex) {
// failed to copy the headers. sdk will perform the download instead.
android.util.Log.e(TAG, "failed to copy headers asset", ex);
} finally {
closeStream(in);
closeStream(out);
// only mark the copy as successful if the file sizes are the same
targetLen = targetHeadersFile.exists() ? targetHeadersFile.length() : 0;
android.util.Log.d(TAG, String.format("SourceLength=%d; TargetLength=%d", sourceLen, targetLen));
if (targetLen > 0 && targetLen == sourceLen) {
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean(HEADERS_ASSET_KEY, true);
editor.commit();
}
}
return null;
}
protected void onPostExecute(Void result) {
Intent intent = buildIntent(ctx, pythonServiceArgument, serviceClass, pythonName);
ctx.startService(intent);
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
public static void stop(Context ctx, Class serviceClass) {
Intent intent = new Intent(ctx, serviceClass);
ctx.stopService(intent);
}
private static void closeStream(Closeable closeable) {
try {
if (closeable != null) {
closeable.close();
}
} catch (IOException ex) {
// pass
}
}
}
@@ -25,10 +25,14 @@ import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.common.MapBuilder;
import com.squareup.picasso.Picasso;
import java.io.File;
import java.io.Closeable;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@@ -60,6 +64,10 @@ public class UtilityModule extends ReactContextBaseJavaModule {
public static final String RECEIVE_CREATOR_NOTIFICATIONS = "receiveCreatorNotifications";
// the last language set to be loaded
private static final String LANGUAGE_SETTING_KEY = "language";
private String language;
private Context context;
@@ -73,6 +81,16 @@ public class UtilityModule extends ReactContextBaseJavaModule {
} catch (Exception ex) {
// continue without keystore
}
SharedPreferences sp = context.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
language = sp.getString(LANGUAGE_SETTING_KEY, "en");
}
@Override
public Map<String, Object> getConstants() {
final Map<String, Object> constants = MapBuilder.newHashMap();
constants.put("language", language);
return constants;
}
@Override
@@ -122,7 +140,6 @@ public class UtilityModule extends ReactContextBaseJavaModule {
View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
}
});
}
}
@@ -397,6 +414,26 @@ public class UtilityModule extends ReactContextBaseJavaModule {
}
}
@ReactMethod
public void setNativeStringSetting(String key, String value) {
if (context != null) {
SharedPreferences sp = context.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putString(key, value);
editor.commit();
}
}
@ReactMethod
public void getNativeStringSetting(String key, String defaultValue, Promise promise) {
if (context != null) {
SharedPreferences sp = context.getSharedPreferences(MainActivity.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
promise.resolve(sp.getString(key, defaultValue));
} else {
promise.resolve(null);
}
}
@ReactMethod
public void getNotificationLaunchTarget(Promise promise) {
Activity activity = MainActivity.getActivity();
+1 -1
View File
@@ -1,4 +1,4 @@
__version__ = "0.11.0"
__version__ = "0.12.0"
class ServiceApp(App):
def build(self):