-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PushNotification.createChannel is not a function #361
Comments
It should work without createChannel, remove that and try again. I will update the docs. |
I've removed the offending lines above, but I am receiving no push notifications on Android. Here is my code: client
server:
Note that the _raix_push_app_tokens collection contains no entry for my userId. I suppose this must be the reason for the failure. Is there something else I should be doing to create this entry? |
@madc0w you can remove android_channel_id from your notif object, it wont affect the functionality. i.e your server's config.js should be like
|
I replaced the server config with the one you specified. I still have no entry for a new user in the _raix_push_app_tokens collection. Of course, no notification is received. Instead, now the server simply crashes when Push.send is called. Here is what I see in the server log:
I also get this strange little message from Sentry:
I hope this give you a clue... I'm not sure where to go from here. By the way, here are the versions of everything that we are using: |
The errors are not helpful, but change the plugin versions.
Also what is your meteor version? |
Hi again, Meteor 1.8.0.2 I'll try again with the specific versions you indicated. Will report back later. |
Using the versions you suggest results in this failure when building the APK:
No idea where to go from here. |
That's an expected error and your meteor version is ok, I'm also on 1.8. Just follow the Updates For Android 8.0 steps on the main page https://github.com/raix/push Also, when you follow the steps remember to open your build.gradle in android studio instead of editor and build there, that will give you the proper information of what's happening step by step. Ping me if you get stuck at any point. |
Thanks for the tip, but I don't find any file named "build.gradle" in my project. Where should I expect to find this? Also, the first line under the "Updates for Android 8.0" section you cite states:
I assume this is meant to say "1.6.1 or above"? The next line reads
To what do these version numbers refer, exactly? Where can I find them? And then, of course, there is this bit:
and
As we already saw, the PushNotification.createChannel function does not exist. I assume this advice will still be irrelevant after these manipulations? One more thing: Assuming I manage to execute this procedure, can we then go back to using our normal build script: Thanks for your help so far! |
|
Hi, Here is the latest output from "meteor build":
As suggested in the docs, I tried adding :
to the build.gradle file. I put these lines at the end of the file, after the line
I don't know if this is the right place, as the docs don't specify. The funny thing is, exactly one of my various attempts to build did actually succeed, but since then, I've been unable to reproduce this success. Also, I'm not sure why I installed Android Studio. It seems like all the manipulations needed here are only in this one build.gradle file. Why is Android Studio needed? Am I missing something?? I've tried following the advice given in this post
which I had added according to the raix:push docs. Doing so results in:
I should mention that each build test takes 10 minutes, so this process is fairly taxing. Maybe you could provide a working example of a build.gradle file? |
The build should not take that much time (at max 1 - 1.5 min) and android studio is not compulsory. Have you added your |
Thanks for the speedy reply! You've been great so far. I didn't see any mention of this google-services.json file in the raix:push docs. I've now downloaded this file from google and added it in the path you specified above. No effect. Still:
and, as before, commenting out the line as above results in this error being replaced with
So, no change. |
Alright, I deleted everything and started fresh from a clone of my project. Follow these steps exactly:
Added dependencies (around line 34 you will find this):
At the end of the file I added
No errors now, successfully installed my app in mobile. |
After some very tedious trial and error, we finally found our culprit. This guy: As explained here
and then
If you're like me, you will see:
I think this has nothing to do with raix:push or phonegap-push-plugin, but rather this crappy Mixpanel plugin is to blame. Anyway, a million thanks for your help and patience. Now that we can build the APK, we will continue testing. |
Glad to be of help! |
Just in case anyone else is interested, I opened an issue with cordova-mixpanel-plugin regarding this. Here is the link: After removing the offending Mixpanel plugin, I can now build the APK, but now, attempting to run on device yields the following:
and it goes on like this for a great many lines, until finally:
Anyway... the fun never stops. |
Did you get any success with this? |
Since you asked... not so much. It seems I'm not alone with this issue, but the responses I've seen are all over the map, and I've yet to find one that would be relevant to my very simple test. If you have the inclination, feel free to give it a try: |
Sure, I will give it a try. |
Edit: Logs
|
@shivang007 when i'm triggering |
Dont add the sdk's which firebase wants you to add. Because theyr already added by raix phonegap push etc plugins. So when you try add the sdk's to main gradles by hand, it has errors cus it duplicated. And here is why you get the PushNotification is not defined. Push notification is defined on the cordova side so when you try to call it on web its says its not defined. My advice is call Meteor.isCordova before your PushNotification .createChannel so you will get no error. I hope it works. |
The following code, copied directly from the docs:
results in :
TypeError: PushNotification.createChannel is not a function
in versions file:
raix:push@3.4.1
The text was updated successfully, but these errors were encountered: