Giter VIP home page Giter VIP logo

Comments (10)

junweimah avatar junweimah commented on July 20, 2024

I have solved the following error by changing the payload and URL to the following :

URL : https://android.googleapis.com/gcm/send
payload :
"data":{
"data":{
"alert": "Testing",
"title": "This is title test",
"tag":"BB",
"id":2,
}
},
"to" : my_device_token

But now however, another problem arise

When I push when my app is opened, I get this empty notification :

screenshot_20161123-122011

When I push when my app is closed, I get 2 notifications. 1 is showing the correct text, one is empty, just like the one i got when my app is open

screenshot_20161123-121944

In both cases, when my app is closed and is opened, in the log file i am getting the correct data in the callback :

image

Why is the notification come in differently when the app is opened and closed?

from ti.goosh.

progress44 avatar progress44 commented on July 20, 2024

hi @junweimah. Please check the documentation when sending the payload. It seems like a malformed payload. I tried sending notifications both with the app closed and with it opened before the release and they worked. I'll make some other tests just in case

from ti.goosh.

junweimah avatar junweimah commented on July 20, 2024

@progress44 Ok I'll do some changes accordingly. thanks.

from ti.goosh.

progress44 avatar progress44 commented on July 20, 2024

@junweimah anytime. Let me know if it's fixed

from ti.goosh.

junweimah avatar junweimah commented on July 20, 2024

I have checked everything and honestly I am not sure whether it's the payload problem.

I pushed using this payload, which is almost the same as the previously try in my second comment in this post:

{
 "data": {
  	"data":{
             "alert": "Testing alert and content",
             "title": "this is title",
             "tag": "bb",
             "vibrate": true,
             "sound": true,
             "id": 2,
    }
 },
   "to" :my_device_token
}

But now I am getting no notification, but a blank alert in the middle of the screen when the app is opened :

img_20161124_111229

For when app is closed, the same still happens, I am getting 2 notifications, one is showing the correct text, one is empty

from ti.goosh.

junweimah avatar junweimah commented on July 20, 2024

Latest update

Everything is fixed. There are some problems in my other module and I fixed them.

Thanks.

from ti.goosh.

bert-w avatar bert-w commented on July 20, 2024

also had this problem here. Sending the payload with data.data.alert as shown above worked for me as well. This syntax seems really odd...

Can you release this soon?

from ti.goosh.

progress44 avatar progress44 commented on July 20, 2024

We kept this syntax to maintain the same data structure with iOS so it will most probably remain the same.

from ti.goosh.

bert-w avatar bert-w commented on July 20, 2024

Im sending data on php-side using:

$data = json_encode(
    [
      'to' => $params[ 'registrationid' ],
      'notification' => [
        'title' => 'Welcome to my app',
        'body' => 'The Message',
        'icon' => 'uzb_a',
        'color' => '#c12139',
      ],
      'data' => [
        'data' => [
          'alert' => 'SOMEDATA'
        ]
      ]
    ]
  );

This is the exact data retrieved under TiGoosh.registerForPushNotifications-callback function (Android):
schermafbeelding 2017-02-02 om 16 41 30

This is the exact data retrieved using Ti.Network.registerForPushNotifications-callback function (iOS):
schermafbeelding 2017-02-02 om 16 37 42


Something seems off here

from ti.goosh.

progress44 avatar progress44 commented on July 20, 2024

Yeah definitely

from ti.goosh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.