Meteor-Community-Packages / raix-push

DEPRECATED: Push notifications for cordova (ios, android) browser (Chrome, Safari, Firefox)
https://atmospherejs.com/raix/push
MIT License
514 stars 197 forks source link

PushNotification.createChannel is not a function #361

Closed madc0w closed 5 years ago

madc0w commented 5 years ago

The following code, copied directly from the docs:

    PushNotification.createChannel(() => {
        console.log("Channel created");
    }, () => {
        clientUtils.logError("Failed to create channel", true);
    }, {
        id : Meteor.userId(), // the same Id for this channel must be sent from the server
        description : "Spoticle notification channel",
        importance : 3,
        vibration : true,
    });

results in :

TypeError: PushNotification.createChannel is not a function

in versions file: raix:push@3.4.1

shivang007 commented 5 years ago

It should work without createChannel, remove that and try again. I will update the docs.

madc0w commented 5 years ago

I've removed the offending lines above, but I am receiving no push notifications on Android. Am I also meant to remove references to android_channel_id?

Here is my code:

client

        Push.Configure({
            android : {
                senderID : Meteor.settings.public.gcmSenderId,
                alert : true,
                badge : true,
                sound : true,
                icon : "ic_stat_icon_005_alpha_only",
                iconColor : "#00b3ff"
            },
            ios : {
                alert : true,
                badge : true,
                sound : true
            }
        });

        Push.enabled(true);

server:

        Push.Configure({
            apn : {
                certData : Assets.getText(apsCertFilename),
                keyData : Assets.getText(apsKeyFilename),
            gcm : {
                apiKey : Meteor.settings.private.gcmApiKey,
            },
            production : true,
            sound : true,
            badge : true,
            alert : true,
            vibrate : true,
        });

    Push.addListener("error", function(err) {
        console.error("error on push: " + err);  // no error is received here
    });

            const notif = {
                android_channel_id : user._id ,
                from : "push",
                title : titleText,
                text : messageText,
                badge : badge,
                sound : "airhorn.caf",
                payload : {
                    text : messageText,
                    id : id,
                    type : parentType
                },
                gcm : {
                    style : "inbox",
                    summaryText : summaryText
                },
                query : {
                    userId: user._id
                }
            };
            try {
                Push.send(notif);
                // we see this in the log
                console.log("sent push notification to " + (user ? user.username + " (" + user._id + ")" : "all users")); // + " : \n" + JSON.stringify(notif));
            } catch (err) {
                // no error is thrown here.
                console.error("Failed push notification", notif);
                console.error(err);
            }

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?

shivang007 commented 5 years ago

@madc0w you can remove android_channel_id from your notif object, it wont affect the functionality. Also have you allowed the security allow/deny? And the Push configuration has to be inside Meteor.startup() for both client and server side.

i.e your server's config.js should be like

Meteor.startup(() => {
   Push.debug = false;
   Push.Configure({
     gcm: {
       apiKey: 'YOUR_API_KEY',
       projectNumber: YOUR_SENDER_ID
     },
     apn: {
       certData: Assets.getText('meteorApp-cert-prod.pem'),
       keyData: Assets.getText('meteorApp-key-prod.pem'),
       passphrase: 'YOUR_PASS_PHRASE',
       production: true,
       gateway: 'gateway.push.apple.com',
     },
     sound: true
   });

  /*security allow/deny*/
  Push.allow({
     send: (userId, notification) => {
       // allow all users to send notifications
       return true;
     }
   });
 });
madc0w commented 5 years ago

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:

2019-02-13 09:01:04+01:00 13 Feb 08:01:04 - uncaughtException: e1c84cb7781f47c7b6f044529bd30b4f
2019-02-13 09:01:04+01:00 13 Feb 08:01:04 - uncaughtException: 0870afcb781a40098045757e81c2e5f7
2019-02-13 09:01:04+01:00 13 Feb 08:01:04 - uncaughtException: 32a6b553b817436e8512f0ac8bb6f147

I also get this strange little message from Sentry:

Error: [sprintf] huh?

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: phonegap-plugin-push@2.2.3 cordova-plugin-device@2.0.2 raix:push@3.4.1

shivang007 commented 5 years ago

The errors are not helpful, but change the plugin versions. I am using:

phonegap-plugin-push@2.1.3
cordova-plugin-device@1.1.6

Also what is your meteor version?

madc0w commented 5 years ago

Hi again,

Meteor 1.8.0.2

I'll try again with the specific versions you indicated. Will report back later.

madc0w commented 5 years ago

Using the versions you suggest results in this failure when building the APK:

This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.10/userguide/gradle_daemon.html
%% Command finished with error code 0: /usr/share/gradle/bin/gradle -p,/home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android,wrapper,-b,/home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/wrapper.gradle
Subproject Path: CordovaLib Android          \
%% Running command: /home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/gradlew cdvBuildRelease -b /home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true
Configuration 'compile' in project ':' is deprecated. Use 'implementation' instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
    at build_5o3iy2wblvvna2vuapb9i506b.run(/home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/build.gradle:144)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
:preBuild UP-TO-DATEapp for Android          \
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:processReleaseManifest
   Building Cordova app for Android          -                
:CordovaLib:compileReleaseAidl
:compileReleaseAidl
:CordovaLib:packageReleaseRenderscript NO-SOURCE
:compileReleaseRenderscript
:checkReleaseManifest
:generateReleaseBuildConfig
:prepareLintJar
:generateReleaseResValues
:generateReleaseResources
:processReleaseGoogleServices
Found com.google.android.gms:play-services-base:+, but version 11.6.2 is needed for the google-services plugin.
Found com.google.android.gms:play-services-gcm:+, but version 11.6.2 is needed for the google-services plugin.
:processReleaseGoogleServices FAILED
11 actionable tasks: 11 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processReleaseGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.2.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
%% Command finished with error code 1: /home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/gradlew cdvBuildRelease,-b,/home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
=> Errors executing Cordova commands:         

   While building Cordova app for platform Android:
   Error: /home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/gradlew: Command failed with exit code 1 Error output:
   FAILURE: Build failed with an exception.

   * What went wrong:
   Execution failed for task ':processReleaseGoogleServices'.
   > Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available
   at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.2.

   * Try:
   Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

   * Get more help at https://help.gradle.org

   BUILD FAILED in 13s
   at ChildProcess.whenDone
   (/home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
   at emitTwo (events.js:126:13)
   at ChildProcess.emit (events.js:214:7)
   at maybeClose (internal/child_process.js:925:16)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
./build-android.sh: line 85: cd: /home/mad/spoticle-build/android/project/build/outputs/apk/release: No such file or directory

No idea where to go from here.

shivang007 commented 5 years ago

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.

madc0w commented 5 years ago

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:

Meteor must be version 1.6.1

I assume this is meant to say "1.6.1 or above"?

The next line reads

Cordova Android must be version 6.3.0 Cordova IOS must be version 4.5.0

To what do these version numbers refer, exactly? Where can I find them?

And then, of course, there is this bit:

Changes for the API: On the client make sure you add a android channel:

PushNotification.createChannel(

and

Add the android_channel_id so the Push message like below:

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: meteor build --mobile-settings $settingsFile --verbose ~/spoticle-build --server=$server or must we now go through this whole process each time we do a meteor reset??

Thanks for your help so far!

shivang007 commented 5 years ago
  1. After you build your project locally using meteor --settings your_settings.js run android-device, you can find this file at YOUR_PROJECT_DIR/.meteor/local/cordova-build/platforms/android

  2. Yes it means 1.6.1 or above. And if you read the next line you will see that meteor 1.6.1 takes care of these versions (don't need to do anything about this, meteor 1.8 takes care of this).

  3. The android_channel_id is required for android 8 - Oreo, but it is working fine without this (For me it's working in production), so it's ok if you don't follow that android_channel_id step.

  4. This will work until you delete your .meteor/local folder. Also once you finish this process and build locally, you can use your normal build script meteor build --mobile-settings $settingsFile --verbose ~/your-build --server=$server and your apk will have the working push functionality.

madc0w commented 5 years ago

Hi,

Here is the latest output from "meteor build":

FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Cannot add task ':processDebugGoogleServices' as a task with that name already exists.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 31s
%% Command finished with error code 1: /home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/gradlew cdvBuildRelease,-b,/home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
=> Errors executing Cordova commands:         

   While building Cordova app for platform Android:
   Error: /home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/gradlew: Command failed with exit code 1 Error output:
   FAILURE: Build failed with an exception.

   * What went wrong:
   A problem occurred configuring root project 'android'.
   > Cannot add task ':processDebugGoogleServices' as a task with that name already exists.

   * Try:
   Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

   * Get more help at https://help.gradle.org

   BUILD FAILED in 31s
   at ChildProcess.whenDone
   (/home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
   at emitTwo (events.js:126:13)
   at ChildProcess.emit (events.js:214:7)
   at maybeClose (internal/child_process.js:925:16)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

As suggested in the docs, I tried adding :

configurations.all {
  resolutionStrategy {
    force 'com.android.support:support-v4:27.1.0'
  }
}

configurations {
  all*.exclude group: 'com.android.support', module: 'support-v13'
}

to the build.gradle file. I put these lines at the end of the file, after the line

apply plugin: 'com.google.gms.google-services'

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 https://stackoverflow.com/questions/45095467/cannot-add-task-processdebuggoogleservices-as-a-task-with-that-name-already-e which suggested removing the line

apply plugin: 'com.google.gms.google-services'

which I had added according to the raix:push docs. Doing so results in:

Found com.google.android.gms:play-services-base:+, but version 11.6.2 is needed for the google-services plugin.
Found com.google.android.gms:play-services-gcm:+, but version 11.6.2 is needed for the google-services plugin.
:processReleaseGoogleServices FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processReleaseGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.2.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 12s
11 actionable tasks: 11 executed
%% Command finished with error code 1: /home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/gradlew cdvBuildRelease,-b,/home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
=> Errors executing Cordova commands:         

   While building Cordova app for platform Android:
   Error: /home/mad/git/spoticle/.meteor/local/cordova-build/platforms/android/gradlew: Command failed with exit code 1 Error output:
   FAILURE: Build failed with an exception.

   * What went wrong:
   Execution failed for task ':processReleaseGoogleServices'.
   > Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available
   at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.2.

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?

shivang007 commented 5 years ago

The build should not take that much time (at max 1 - 1.5 min) and android studio is not compulsory. Have you added your google-services.json file in cordova-build/platforms/android ?

madc0w commented 5 years ago

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:

A problem occurred configuring root project 'android'.
> Cannot add task ':processDebugGoogleServices' as a task with that name already exists.

and, as before, commenting out the line as above results in this error being replaced with

Execution failed for task ':processReleaseGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.2.

So, no change.

shivang007 commented 5 years ago

Alright, I deleted everything and started fresh from a clone of my project. Follow these steps exactly:

  1. Change your meteor version to 1.8 instead of 1.8.0.2 (This might be the one causing problem, also keep the phonegap-plugin-push and cordova-plugin-device versions same as mine).

  2. Delete your local folder inside .meteor

  3. Run meteor --settings your_settings_file.json run android-device You will receive an error here:

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Could not resolve all files for configuration ':debugCompileClasspath'.
    > Could not find support-v4.jar (com.android.support:support-v4:26.1.0).
    Searched in the following locations:
    https://jcenter.bintray.com/com/android/support/support-v4/26.1.0/support-v4-26.1.0.jar
  4. Place your google-services.json file at .meteor/local/cordova-build/platforms/android.

  5. Open build.gradle file located at above position and make these changes:

Added dependencies (around line 34 you will find this):

dependencies {
        //Below my existing dependencies I added these 2:
        classpath 'com.google.gms:google-services:4.1.0'
        classpath 'com.google.firebase:firebase-core:11.0.1'
}

At the end of the file I added

configurations.all {
  resolutionStrategy {
    force 'com.android.support:support-v4:27.1.0'
  }
}

configurations {
  all*.exclude group: 'com.android.support', module: 'support-v13'
}

apply plugin: 'com.google.gms.google-services'
  1. Again run meteor --settings your_settings_file.json run android-device I received an error:

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring root project 'android'.
    > Cannot add task ':processDebugGoogleServices' as a task with that name already exists.
  2. Removed the apply plugin: 'com.google.gms.google-services' from build.gradle.

  3. Now run meteor --settings your_settings_file.json run android-device

No errors now, successfully installed my app in mobile.

madc0w commented 5 years ago

After some very tedious trial and error, we finally found our culprit. This guy: https://github.com/samzilverberg/cordova-mixpanel-plugin

As explained here https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md#common-errors if a cordova plugin (the above cited Mixpanel plugin, in this case) fail to make proper use of gradle, then the build will crash. You can try it yourself in your test project to confirm. Just:

meteor add cordova:cordova-plugin-mixpanel@4.5.2

and then

meteor build --mobile-settings $settingsFile --verbose ~/apk-test-build --server=$server

If you're like me, you will see:

Execution failed for task ':processReleaseGoogleServices'.

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.

shivang007 commented 5 years ago

Glad to be of help! Also when you test, you might find your app icon from notification-tray missing, follow https://github.com/raix/push/pull/359#issuecomment-459061452 for that.

madc0w commented 5 years ago

Just in case anyone else is interested, I opened an issue with cordova-mixpanel-plugin regarding this.

Here is the link: https://github.com/samzilverberg/cordova-mixpanel-plugin/issues/98

After removing the offending Mixpanel plugin, I can now build the APK, but now, attempting to run on device yields the following:

=> Started your app.                          

=> App running at: http://localhost:3000/     
=> Started app on Android Device.             
I20190216-12:52:13.199(1)? 02-16 12:27:28.294  1915  1915 I CordovaLog: Changing log level to DEBUG(3)
I20190216-12:52:13.200(1)? 02-16 12:27:28.704  1915  1915 I chromium: [INFO:library_loader_hooks.cc(42)] Chromium logging enabled: level = 0, default verbosity = 0
I20190216-12:52:13.204(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp: Could not load asset manager cache
I20190216-12:52:13.204(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp: java.io.FileNotFoundException: cdvasset.manifest
I20190216-12:52:13.205(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.content.res.AssetManager.openAsset(Native Method)
I20190216-12:52:13.205(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.content.res.AssetManager.open(AssetManager.java:364)
I20190216-12:52:13.205(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.content.res.AssetManager.open(AssetManager.java:338)
I20190216-12:52:13.205(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at com.meteor.webapp.AssetManagerCache.<init>(AssetManagerCache.java:20)
I20190216-12:52:13.205(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at com.meteor.webapp.WebAppLocalServer.pluginInitialize(WebAppLocalServer.java:107)
I20190216-12:52:13.206(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at org.apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.java:58)
I20190216-12:52:13.206(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:171)
I20190216-12:52:13.206(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97)
I20190216-12:52:13.206(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at org.apache.cordova.PluginManager.init(PluginManager.java:86)
I20190216-12:52:13.206(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:115)
I20190216-12:52:13.207(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:149)
I20190216-12:52:13.207(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:224)
I20190216-12:52:13.207(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at com.spoticle.MainActivity.onCreate(MainActivity.java:39)
I20190216-12:52:13.207(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.app.Activity.performCreate(Activity.java:6904)
I20190216-12:52:13.207(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
I20190216-12:52:13.208(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
I20190216-12:52:13.208(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
I20190216-12:52:13.208(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.app.ActivityThread.access$1100(ActivityThread.java:229)
I20190216-12:52:13.208(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
I20190216-12:52:13.208(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.os.Handler.dispatchMessage(Handler.java:102)
I20190216-12:52:13.208(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.os.Looper.loop(Looper.java:148)
I20190216-12:52:13.209(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at android.app.ActivityThread.main(ActivityThread.java:7325)
I20190216-12:52:13.209(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at java.lang.reflect.Method.invoke(Native Method)
I20190216-12:52:13.209(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
I20190216-12:52:13.209(1)? 02-16 12:27:29.724  1915  1915 E MeteorWebApp:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
I20190216-12:52:13.209(1)? 02-16 12:27:29.894  1915  2076 F chromium: [FATAL:jni_android.cc(249)] Please include Java exception stack in crash report
I20190216-12:52:13.210(1)? 02-16 12:27:30.804  2148  2148 F google-breakpad: -----BEGIN BREAKPAD MICRODUMP-----
I20190216-12:52:13.210(1)? 02-16 12:27:30.804  2148  2148 F google-breakpad: V AndroidWebView:72.0.3626.105
I20190216-12:52:13.210(1)? 02-16 12:27:30.804  2148  2148 F google-breakpad: O A arm 04 armv7l samsung/j5ltexx/j5lte:6.0.1/MMB29M/J500FXXU1BQH1:user/release-keys
I20190216-12:52:13.210(1)? 02-16 12:27:30.804  2148  2148 F google-breakpad: P webview
I20190216-12:52:13.211(1)? 02-16 12:27:30.804  2148  2148 F google-breakpad: R 00000007 SIGBUS A33E6B7C
I20190216-12:52:13.211(1)? 02-16 12:27:30.804  2148  2148 F google-breakpad: G 
I20190216-12:52:13.211(1)? 02-16 12:27:30.804  2148  2148 F google-breakpad: H 12C00000 BEDC4000 0015 23244000 774C2000 0C:06 0D:02 0E:03 10:01 13:01 15:01 19:01 1A:01 1B:02 1C:02 1D:01
I20190216-12:52:13.211(1)? 02-16 12:27:30.804  2148  2148 F google-breakpad: S 0 9E950ED0 9E950000 00002000
I20190216-12:52:13.211(1)? 02-16 12:27:30.804  2148  2148 F google-breakpad: S 9E950000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
I20190216-12:52:13.212(1)? 02-16 12:27:30.804  2148  2148 F google-breakpad: S 9E950180 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

and it goes on like this for a great many lines, until finally:

I20190216-12:52:13.276(1)? 02-16 12:27:30.834  2148  2148 F google-breakpad: -----END BREAKPAD MICRODUMP-----
I20190216-12:52:13.276(1)? 02-16 12:27:30.854  1915  2076 F libc    : Fatal signal 7 (SIGBUS), code -6, fault addr 0x77b in tid 2076 (TaskSchedulerFo)
I20190216-12:52:13.276(1)? 02-16 12:27:30.914   388   388 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I20190216-12:52:13.276(1)? 02-16 12:27:30.914   388   388 F DEBUG   : Build fingerprint: 'samsung/j5ltexx/j5lte:6.0.1/MMB29M/J500FXXU1BQH1:user/release-keys'
I20190216-12:52:13.276(1)? 02-16 12:27:30.914   388   388 F DEBUG   : Revision: '5'
I20190216-12:52:13.277(1)? 02-16 12:27:30.914   388   388 F DEBUG   : ABI: 'arm'
I20190216-12:52:13.277(1)? 02-16 12:27:30.914   388   388 F DEBUG   : pid: 1915, tid: 2076, name: TaskSchedulerFo  >>> com.spoticle <<<
I20190216-12:52:13.277(1)? 02-16 12:27:30.914   388   388 F DEBUG   : signal 7 (SIGBUS), code -6 (SI_TKILL), fault addr 0xa33e6b7c
I20190216-12:52:13.277(1)? 02-16 12:27:30.954   388   388 F DEBUG   : Abort message: '[FATAL:jni_android.cc(249)] Please include Java exception stack in crash report
I20190216-12:52:13.277(1)? 02-16 12:27:30.954   388   388 F DEBUG   : '
I20190216-12:52:13.277(1)? 02-16 12:27:30.954   388   388 F DEBUG   :     r0 00000000  r1 b787f7e0  r2 00000400  r3 00000000
I20190216-12:52:13.277(1)? 02-16 12:27:30.954   388   388 F DEBUG   :     r4 9e951334  r5 9e951338  r6 a47802cc  r7 b6cfe4cc
I20190216-12:52:13.277(1)? 02-16 12:27:30.954   388   388 F DEBUG   :     r8 9e950f00  r9 9e950ee5  sl 9e950ee4  fp 0000004f
I20190216-12:52:13.277(1)? 02-16 12:27:30.954   388   388 F DEBUG   :     ip 9e950f04  sp 9e950ed0  lr a33e6aa3  pc a33e6b7c  cpsr 600b0030
I20190216-12:52:13.278(1)? 02-16 12:27:30.954   388   388 F DEBUG   : 
I20190216-12:52:13.278(1)? 02-16 12:27:30.954   388   388 F DEBUG   : backtrace:
I20190216-12:52:13.278(1)? 02-16 12:27:30.954   388   388 F DEBUG   :     #00 pc 013dbb7c  /data/app/com.google.android.webview-2/lib/arm/libwebviewchromium.so (offset 0x745000)
I20190216-12:52:13.278(1)? 02-16 12:27:31.894   388   388 F DEBUG   : 
I20190216-12:52:13.278(1)? 02-16 12:27:31.894   388   388 F DEBUG   : Tombstone written to: /data/tombstones/tombstone_05
I20190216-12:52:13.404(1)? 02-16 12:52:57.954 22608 22608 I chromium: [INFO:library_loader_hooks.cc(42)] Chromium logging enabled: level = 0, default verbosity = 0

Anyway... the fun never stops.

shivang007 commented 5 years ago

Did you get any success with this?

madc0w commented 5 years ago

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.

https://github.com/raix/push/issues/363

If you have the inclination, feel free to give it a try: https://github.com/madc0w/push-test

shivang007 commented 5 years ago

Sure, I will give it a try.

shivang007 commented 5 years ago

Works for me xD screenshot_2019-02-20-16-37-50-166_com miui home 1 screenshot_2019-02-20-16-37-54-684_com miui home 1

Edit: Logs

I20190220-16:36:51.289(5.5)? A:Send message to: epMILxDWeWk:APA91bEcv7sfb3mfUKhPflv29uH-NfvGg8PRDXgerwDdUsL40yNZTs-2E6uPnVGY9W4ligOmST3zYrxbelgZZBnWoRKqBlpudxeHeun2V3k0zYeP1x0W2icTXcma9hzeqa48s5DE9Q35
I20190220-16:36:51.290(5.5)? Push: Sent message "test title" to 0 ios apps 1 android apps
I20190220-16:36:51.291(5.5)? Push, GUIDE: The "Push.appCollection" - No APN clients have registred on the server yet...
I20190220-16:36:51.406(5.5)? ANDROID: Result of sender: {"multicast_id":6218483523523240000,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1550660811359048%c34c75e20034af1a"}]}
saikatharryc commented 5 years ago

@shivang007 when i'm triggering Push.send() from server side. its not inserting anything to my DB, but i can see there is 2 collection named: _raix_push_app_tokens & _raix_push_notifications. neither i get any notification. i followed from here: https://github.com/raix/push/issues/361#issuecomment-463692629

meroo36 commented 4 years ago

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.