Closed AhmedMSayed closed 6 years ago
how are your intent filters set up inside tiapp?
I don't setup intent filter inside my application tag and if I set one it should be like this
<activity
android:configChanges="keyboardHidden|orientation|fontScale|screenSize|smallestScreenSize|screenLayout|density"
android:label="Sample"
android:name=".SampleActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Another error related to this
[ERROR] : WindowManager:
[ERROR] : WindowManager: android.view.WindowLeaked: Activity org.appcelerator.titanium.TiActivity has leaked window DecorView@965bf62[] that was originally added here
[ERROR] : WindowManager: at android.view.ViewRootImpl.<init>(ViewRootImpl.java:487)
[ERROR] : WindowManager: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:365)
[ERROR] : WindowManager: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:114)
[ERROR] : WindowManager: at android.app.Dialog.show(Dialog.java:445)
[ERROR] : WindowManager: at org.appcelerator.titanium.TiExceptionHandler.createDialog(TiExceptionHandler.java:201)
[ERROR] : WindowManager: at org.appcelerator.titanium.TiExceptionHandler$1.onCurrentActivityReady(TiExceptionHandler.java:102)
[ERROR] : WindowManager: at org.appcelerator.titanium.util.TiUIHelper.waitForCurrentActivity(TiUIHelper.java:192)
[ERROR] : WindowManager: at org.appcelerator.titanium.TiApplication.waitForCurrentActivity(TiApplication.java:820)
[ERROR] : WindowManager: at org.appcelerator.titanium.TiExceptionHandler.handleOpenErrorDialog(TiExceptionHandler.java:98)
[ERROR] : WindowManager: at org.appcelerator.titanium.TiExceptionHandler.openErrorDialog(TiExceptionHandler.java:60)
[ERROR] : WindowManager: at org.appcelerator.titanium.TiExceptionHandler.handleException(TiExceptionHandler.java:239)
[ERROR] : WindowManager: at org.appcelerator.kroll.KrollRuntime.dispatchException(KrollRuntime.java:538)
[ERROR] : WindowManager: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method)
[ERROR] : WindowManager: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:75)
[ERROR] : WindowManager: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1200)
[ERROR] : WindowManager: at android.os.Handler.dispatchMessage(Handler.java:101)
[ERROR] : WindowManager: at android.os.Looper.loop(Looper.java:156)
[ERROR] : WindowManager: at android.app.ActivityThread.main(ActivityThread.java:6605)
[ERROR] : WindowManager: at java.lang.reflect.Method.invoke(Native Method)
[ERROR] : WindowManager: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:999)
[ERROR] : WindowManager: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:889)
Did you try to add <property name="ti.android.bug2373.finishfalseroot" type="bool">true</property>
to tiapp.xml?
work fine with it @m1ga
but this isn't the solution @m1ga Now the main screen has opened twice.
But are you sure that it is a ti.goosh error? Bug2373 is a long time Appc "bug"
1- Create a new application 2- Add the code below
var win = Ti.UI.createWindow({
backgroundColor: '#ffffff'
});
var TiGoosh = require('ti.goosh');
TiGoosh.registerForPushNotifications({
callback : function(e) {
var data = JSON.parse(e.data || '');
Ti.API.warn("Notification received: " + e.data);
},
success : function(e) {
Ti.API.warn("Device Token received: " + e.deviceToken);
subscribeToChannel();
},
error : function(err) {
Ti.API.warn('Failed to register for push notifications! ' + err);
}
});
function subscribeToChannel() {
TiGoosh.subscribe({
topic : "/topics/myTopic",
success : function(e) {
Ti.API.warn('Subscribed');
},
error : function(e) {
Ti.API.warn('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
}
});
}
win.open();
3- Send new notification from server
[DEBUG] : D/ti.goosh.TiGooshBroadcastReceiver: started
[WARN] : Bundle: Key google.sent_time expected String but value was a java.lang.Long. The default value <null> was returned.
[WARN] : Bundle: Attempt to cast generated internal exception:
[WARN] : Bundle: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
[WARN] : Bundle: at android.os.BaseBundle.getString(BaseBundle.java:995)
[WARN] : Bundle: at com.google.android.gms.gcm.zza.zzu(Unknown Source)
[WARN] : Bundle: at com.google.android.gms.gcm.GcmListenerService.handleIntent(Unknown Source)
[WARN] : Bundle: at com.google.firebase.iid.zzc.run(Unknown Source)
[WARN] : Bundle: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
[WARN] : Bundle: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
[WARN] : Bundle: at java.lang.Thread.run(Thread.java:761)
[WARN] : Bundle: Key google.ttl expected String but value was a java.lang.Integer. The default value <null> was returned.
[WARN] : Bundle: Attempt to cast generated internal exception:
[WARN] : Bundle: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
[WARN] : Bundle: at android.os.BaseBundle.getString(BaseBundle.java:995)
[WARN] : Bundle: at com.google.android.gms.gcm.zza.zzu(Unknown Source)
[WARN] : Bundle: at com.google.android.gms.gcm.GcmListenerService.handleIntent(Unknown Source)
[WARN] : Bundle: at com.google.firebase.iid.zzc.run(Unknown Source)
[WARN] : Bundle: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
[WARN] : Bundle: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
[WARN] : Bundle: at java.lang.Thread.run(Thread.java:761)
[DEBUG] : D/ti.goosh.IntentService: Push notification received from: /topics/myTopic
[DEBUG] : D/ti.goosh.IntentService: Notification key : google.sent_time => 1519312183970 (java.lang.Long)
[DEBUG] : D/ti.goosh.IntentService: Notification key : google.ttl => 2419200 (java.lang.Integer)
[DEBUG] : D/ti.goosh.IntentService: Notification key : google.message_id => 0:1519312184245463%f7b502dcf7b502dc (java.lang.String)
[DEBUG] : D/ti.goosh.IntentService: Notification key : notification => Bundle[{priority=high, sound=default, title=test 1, time_to_live=3600}] (android.os.Bundle)
[DEBUG] : D/ti.goosh.IntentService: Notification key : collapse_key => com.example.testnotifi (java.lang.String)
[WARN] : Notification received: {"c.i": "null"}
[WARN] : W/ti.goosh.IntentService: Show Notification: FALSE
4- click on the notification
[ERROR] : TiLaunchActivity: (main) [542564,542564] Android issue 2373 detected (missing intent CATEGORY_LAUNCHER or FLAG_ACTIVITY_RESET_TASK_IF_NEEDED), restarting app. com.example.testnotifi.TestnotifiActivity@1aaa2fe
I am facing the sameApp stuck issue and getting following error in my console, Did you find any solution for this, please let me know?
[ERROR] : TiExceptionHandler: (main) [15128,88247] Not allowed to start service Intent { cmp=ca.wearecircus.bcc/com.radiusnetworks.ibeacon.IBeaconIntentProcessor (has extras) }: app is in background uid UidRecord{fe9fde7 u0a474 LAST bg:+1m3s223ms idle procs:1 seq(0,0,0)} [ERROR] : TiExceptionHandler: [ERROR] : TiExceptionHandler: android.app.ContextImpl.startServiceCommon(ContextImpl.java:1538) [ERROR] : TiExceptionHandler: android.app.ContextImpl.startService(ContextImpl.java:1484) [ERROR] : TiExceptionHandler: android.content.ContextWrapper.startService(ContextWrapper.java:663) [ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.Callback.call(Callback.java:63) [ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.IBeaconService.processRangeData(IBeaconService.java:533) [ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.IBeaconService.finishScanCycle(IBeaconService.java:451) [ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.IBeaconService.scheduleScanStop(IBeaconService.java:436) [ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.IBeaconService.access$100(IBeaconService.java:62) [ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.IBeaconService$2.run(IBeaconService.java:432) [ERROR] : TiExceptionHandler: android.os.Handler.handleCallback(Handler.java:789) [ERROR] : TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiExceptionHandler: android.os.Looper.loop(Looper.java:164) [ERROR] : TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:6944) [ERROR] : TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiExceptionHandler: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) [ERROR] : TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
@PMistry123 that sounds like a different issue and is related to the iBeaconService and not ti.goosh. Are you running on an Android 8+ phone? Check this: https://github.com/AltBeacon/android-beacon-library/issues/673 thread. Perhaps it will lead to a fix
Hi @AhmedMSayed @m1ga , did you find the solution..?? I am facing the same problem.
If I add the <property name="ti.android.bug2373.finishfalseroot" type="bool">true</property>
then on background app restarts only when we open the notification.
Also if the app is in foreground while receiving notification the app restarts automatically. And I am not receiving notifications when app is closed.
Your help is highly appreciable.
Environment: Device: Android 9 Android One Power, TargetSDKVersion: 28, Ti SDK: 7.5.1
1- Receive a notification in the background. 2- Click on it.
TiLaunchActivity: (main) [39356,767231] Android issue 2373 detected (missing intent CATEGORY_LAUNCHER or FLAG_ACTIVITY_RESET_TASK_IF_NEEDED), restarting app. com.example.sample.SampleActivity@e50b29d