Comments (24)
I highly recommend using this plugin: https://github.com/hansemannn/titanium-firebase-cloud-messaging
It works perfectly and no crashes.
from ti.goosh.
Good news .... there is a new push whit the fix 👍
Merge branch 'feature/oreo'
I am whating for the dist version
from ti.goosh.
We've just released a new version of Ti.Goosh that should solve this problem. You can find it here.
Let us know if you're still experiencing the same problem with Ti.Goosh 4.2.0.
from ti.goosh.
Same issue with receiving notifications in background on Android 8.
0-02 11:48:44.700 1969 3885 W ActivityManager: Background start not allowed: service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=ua.com.mhp.agro.dev cmp=ua.com.mhp.agro.dev/ti.goosh.IntentService (has extras) } to ua.com.mhp.agro.dev/ti.goosh.IntentService from pid=14856 uid=10165 pkg=ua.com.mhp.agro.dev
10-02 11:48:44.704 14856 14856 D AndroidRuntime: Shutting down VM
10-02 11:48:44.706 3263 3263 W GCM : broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=ua.com.mhp.agro.dev (has extras) }
10-02 11:48:44.717 14856 14856 E AndroidRuntime: FATAL EXCEPTION: main
10-02 11:48:44.717 14856 14856 E AndroidRuntime: Process: ua.com.mhp.agro.dev, PID: 14856
10-02 11:48:44.717 14856 14856 E AndroidRuntime: java.lang.RuntimeException: Unable to start receiver ti.goosh.BroadcastReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=ua.com.mhp.agro.dev cmp=ua.com.mhp.agro.dev/ti.goosh.IntentService (has extras) }: app is in background uid UidRecord{9df5545 u0a165 RCVR bg:+1m2s763ms idle change:uncached procs:1 seq(0,0,0)}
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.app.ActivityThread.handleReceiver(ActivityThread.java:3228)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.app.ActivityThread.-wrap17(Unknown Source:0)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.os.Looper.loop(Looper.java:171)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6633)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=ua.com.mhp.agro.dev cmp=ua.com.mhp.agro.dev/ti.goosh.IntentService (has extras) }: app is in background uid UidRecord{9df5545 u0a165 RCVR bg:+1m2s763ms idle change:uncached procs:1 seq(0,0,0)}
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1531)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.app.ContextImpl.startService(ContextImpl.java:1487)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.content.ContextWrapper.startService(ContextWrapper.java:660)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.content.ContextWrapper.startService(ContextWrapper.java:660)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService(WakefulBroadcastReceiver.java:99)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at ti.goosh.BroadcastReceiver.onReceive(BroadcastReceiver.java:32)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: at android.app.ActivityThread.handleReceiver(ActivityThread.java:3221)
10-02 11:48:44.717 14856 14856 E AndroidRuntime: ... 8 more
from ti.goosh.
Same problem here...
Any solution?
from ti.goosh.
Has anyone figured out a solution for this?
from ti.goosh.
Google changed notifications settings ... the notifications in Sdk 26 (android 8) stopped working, the problem is in channel, I think we need to wait for an update of ti.goosh.
from ti.goosh.
Still no news on a fix for this?
Play Store now demands that updates has targetSdkVersion=26 so this is important.
from ti.goosh.
Let's hope that someone who can build a new release sees this (today) 🤞
from ti.goosh.
We've merged that fix to try and make the module work with Android Oreo, but there are still things to do. As stated in this comment, there's been radical changes in the way Android handles services. You can find the details here: https://developer.android.com/about/versions/oreo/background.
Basically, methods like "GcmReceiver.startWakefulService()" will throw exception when they are called while the app is closed or flagged as "in background". This means that the current master of Ti.Goosh doesn't show notifications in those cases.
We're trying to migrate the module to the Firebase library to solve these issues.
from ti.goosh.
I have compiled the module ...
ti.goosh-android-4.1.1.zip
I am testing android 8 and 7 (sdk 25,26) and i have problem with the custom sound on android 8 ... and i have only this issue
from ti.goosh.
The good news: This fix solves getting push when app is backgrounded.
Bad news: The push does not show up when the app is dead. Furthermore our app stalls and eventually crashes when starting up from dead after having sent a push to the device.
from ti.goosh.
do you have ?
// subscribe
TiGoosh.subscribe({
topic: "/topics/myTopic",
success: function(e) {
console.log("unsub done " + e);
},
error: function(e){
console.error("error")
}
})```
from ti.goosh.
@furthurr So we need to subscribe to a topic now ? Can be anything ?
from ti.goosh.
I think so, I had the same problem that @andersdp says, so this way was solved xD.
from ti.goosh.
@furthurr It seems unlikely that subscribing to a topic solves the problem of creating a background service from a backgrounded app.
Have you tried sending a notification to the app while it's closed? Is the notification displayed in the tray?
from ti.goosh.
I'm working on a fix (using JobScheduler) here: https://github.com/caffeinalab/ti.goosh/tree/hotfix/android-26-jobservice
from ti.goosh.
@Jei thx for looking into this :) Is there a build available ?
from ti.goosh.
this build have te last modification
ti.goosh-android-4.1.1.zip
from ti.goosh.
this project is compiled with the ti.goosh version that goes up
https://www.youtube.com/watch?v=4b8IyU3YbNU
from ti.goosh.
@furthurr will integrate the build and keep you guyz updated. Thx :)
from ti.goosh.
Seems that build above doesn't have the latest changes.
Works for me only after I built module manually from ab89be5.
Tested when app is in background mode or closed (Android 8.0).
from ti.goosh.
I tried the new version (4.2.0) and it worked just fine on Android 9.
PS: @Jei , why is this issue still opened BTW?
from ti.goosh.
I was just waiting for some feedbacks. I think we can consider this issue solved.
from ti.goosh.
Related Issues (20)
- How can we use both ios? HOT 3
- Failed to get GCM Registration Token:TIMEOUT HOT 1
- Cannot build with 7.1.0 SDK. HOT 10
- Crash Report HOT 2
- Crash report from Google Play HOT 1
- Crash report HOT 2
- Recent crash report HOT 10
- java.lang.ClassCastException receiving foregrounded FCM ttl and sent_time HOT 2
- Silent notification not receiving payload? HOT 2
- Getting invalid sender error
- Compilation Error HOT 10
- Android Oreo Issue --Notification is not receiving in background HOT 3
- Not getting callback when the app is in background or killed HOT 27
- [WARN] : W/ti.goosh.IntentService: Show Notification: FALSE HOT 5
- ti.goosh and ti.admob together
- Use Android notification channels HOT 1
- Firebase support - internal dependencies HOT 8
- Remove app from background, No notification get
- Need to bump version for TiSDK 9.x version HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ti.goosh.