1

I am new at Android developing. I have work on create push notification. But not successfully yet. I have Python for send notification to Android phone (Android 9). This code is:

import urllib 
import json 
import sys
from pyfcm import FCMNotification

def push_to_fcm(device_token, gcm_key, title=None, message=None, data=None, sound=None, badge=None):
    fcm_push_service = FCMNotification(api_key=gcm_key)
    fcm_push_service.notify_single_device(
        registration_id=device_token,
        message_title=title,
        message_body=message,
        data_message=data,
        sound=sound,
        badge=badge
    )

push_to_fcm("myPHoneID","FCMKey","test Title","messagebody")

When I run this py I got weird rectangular shape shown bottom of my phone then close itself. weird message

Where did I do wrong? I want to make regular push notification like "hey you got new message!" Comes from top of the secreen.

Also in simulator I got empty circle shape in bottom of screen

Antiokhos
  • 2,944
  • 5
  • 23
  • 32

0 Answers0