Giter Club home page Giter Club logo

pushnotifications's Introduction

ℙ𝕦𝕀𝕙 ℕ𝕠π•₯π•šπ•—π•šπ•”π•’π•₯π•šπ• π•Ÿπ•€

Buy Me A Coffee

❀️ Support my apps ❀️

β€οΈβ€οΈπŸ˜‡πŸ˜πŸ€˜β€οΈβ€οΈ

Description

  • PushNotitication is an app used for testing push notifications on iOS and Android
  • Support macOS, Windows, Linux
  • Support using certificate and token for authentication with APNS
  • Auto save settings

How to install

How to use

Keep in mind: To connect to APNs you can use either Provider certificate or Authentication Token. They are different ways and Authentication Token is a new one.

Main difference: Provider certificate expires every year and needs to be regenerated (and reuploaded to your server as .p12). Authentication Token is unlimited and you don't have to recreate and reupload it.

iOS Provider Certificate

  • Read more Provider Certificates
  • Go to Member Center
  • Generate Apple Push Notification service SSL (Sandbox & Production), this is now used for both sandbox and production. Download as .cer file
  • Double click on .cer file to install into Keychain, then export it as .p12 file
  • In PushNotifications, select .p12 file, fill out passphase if needed, fill out bundle id, device token, message, select environment
  • message must be in json format, see Creating the Remote Notification Payload

iOS Authentication Token

  • Note your key id
  • In PushNotifications, select .p8 file, fill out key id, team id, bundle id, device token, message, select environment

Android Server Key

  • In PushNotifications, fill out server key, device token, message
  • message must be in json format

Opening app on macOS Catalina or newer (10.15+)

If you installed the app on macOS Catalina using the .dmg file, you will probably see this window when trying to launch the app:

Just press OK and go to System Settings... -> Security & Privacy -> General tab. There you need to press the button Open Anyway.

If you have macOS Ventura or later:

Manual building

In case of issues with running the app on your version of OS, it's possible to easily build it yourself.

Steps:

  1. Download or clone the repository
  2. Install node on your computer (https://nodejs.org/en/)
  3. Run npm install in the root of downloaded/cloned project
  4. Verify that the app can be launched with the command npm start (optional)
  5. Build the project to generate installable files:
  • For building with electron-builder you need to run npm run dist. Generated files end up in the folder dist in the root of your project.

As a result electron-builder will generate:

  • For macOS: .zip, .dmg (if you build using macOS)
  • For Windows: .msi (if you build using Windows)
  • For Linux: .deb, .AppImage (if you build using Linux)

Keep in mind: you cannot build for Windows or Linux, if you are using macOS, or vise versa. It creates installable files only for your current OS.

Credit

Author

Khoa Pham, [email protected]

License

PushNotifications is available under the MIT license. See the LICENSE file for more info.

pushnotifications's People

Contributors

ariandr avatar atsushi-ageet avatar mvandervelden avatar namnm avatar onmyway133 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pushnotifications's Issues

(Simulator only) Wrong device token. iOS device token cannot contain special characters. It must be a string with 64 hexadecimal symbols.

Hello,

I got my simulator's identifier on Xcode's simulator screen. Then paste this id(BB1ZZ4T5-QQFE-62E2-9B52-DF53604GASES) to app and I got error in title.

Failed: Wrong device token. iOS device token cannot contain special characters. It must be a string with 64 hexadecimal symbols. Example: "03ds25c845d461bcdad7802d2vf6fc1dfde97283bf75cn993eb6dca835ea2e2f"

When I convert my bundle id to hex, it counts 72 char.

How can I solve this problem?

Thank you,

Add apns-priority support

As far as I can see there is no way to specify apns-priority, and after inspecting code in node-apn, it uses a default value of 10 unless otherwise specified (https://github.com/node-apn/node-apn/blob/master/lib/notification/index.js#L13).

My silent notifications are not being delivered at all, and I currently suspect that priority might be the cause. Quote from this article:

In a 2019 WWDC session, Apple said that a value of 5 is now required for all β€œcontent-available” notifications. These are notifications that may not contain user-visible data, but are used to invoke the app in the background to download updated content, such as recently received messages. Omitting this may cause the app to not launch.

That being said, it would be great to be able to specify the priority through UI, and simply have it set as the notification property when it's being passed to node-apn.

Is there a way to include apns headers

With watchOS 6 standalone and i think new app there is requirement for

"apns-topic": "#bundle-id" ,
"apns-push-type": "alert",

I think it should go not into body but into the header. So it will be nice to define header fields!

Crash when opening on Catalina

Hi,

I just upgraded and it seems the app is not working anymore on Catalina (10.15.3).

Screenshot 2020-03-30 at 18 04 42
)

Here's the crashlog:

Process:               Push Notifications [17081]
Path:                  /Applications/Push Notifications.app/Contents/MacOS/Push Notifications
Identifier:            com.onmyway133.PushNotifications
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Push Notifications [17081]
User ID:               502

Date/Time:             2020-03-30 18:01:10.706 +0200
OS Version:            Mac OS X 10.15.3 (19D76)
Report Version:        12
Anonymous UUID:        FF747FE5-8447-4DE4-A8E5-7AB1D44366C0

Sleep/Wake UUID:       A84ED7E1-863A-4C86-8F6D-0809FB4D55EE

Time Awake Since Boot: 550000 seconds
Time Since Wake:       13000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (Code Signature Invalid)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace CODESIGNING, Code 0x1

kernel messages:

VM Regions Near 0 (cr2):
--> 
    __TEXT                 000000010f8c4000-000000010f8ee000 [  168K] r-x/rwx SM=COW  

Thread 0 Crashed:
0                                 	0x00000001101bd000 _dyld_start + 0

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000000  rcx: 0x0000000000000000  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x0000000000000000  rbp: 0x0000000000000000  rsp: 0x00007ffee033bba0
   r8: 0x0000000000000000   r9: 0x0000000000000000  r10: 0x0000000000000000  r11: 0x0000000000000000
  r12: 0x0000000000000000  r13: 0x0000000000000000  r14: 0x0000000000000000  r15: 0x0000000000000000
  rip: 0x00000001101bd000  rfl: 0x0000000000000200  cr2: 0x0000000000000000
  
Logical CPU:     0
Error Code:      0x00000000
Trap Number:     0


Binary Images:
       0x10f8c4000 -        0x10f8edff7 + (0) <09E43234-E7F5-3BD2-A492-B374F6A2E494> 
       0x1101bc000 -        0x11024ccb7 + (733.8) <EBC07CB6-870A-3A8E-B48A-67F62EA161F3> 

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 1256553
    thread_create: 262
    thread_set_state: 21628

VM Region Summary:
ReadOnly portion of Libraries: Total=1000K resident=0K(0%) swapped_out_or_unallocated=1000K(100%)
Writable regions: Total=8408K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=8408K(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
STACK GUARD                       56.0M        1 
Stack                             8192K        1 
__DATA                             232K        4 
__DATA_CONST                        20K        1 
__LINKEDIT                         252K        2 
__TEXT                             748K        2 
shared memory                        8K        2 
===========                     =======  ======= 
TOTAL                             65.2M       13 

I've tried to reinstall it with 1.7.3 or the beat version same issue.

getting error

Push Notifications” can’t be opened because Apple cannot check it for malicious software.

Notifications aren't sent to Production environment while using .p8 token (IOS). Error: "Failed: BadDeviceToken"

It seems there is a problem when I switch to the Production environment when I use .p8 token. I get the error: "Failed: BadDeviceToken". But device token is right for Production and I don't get that error, when I use my own server to send the same notification with all the same data (Key Id, Team Id, ...). So, it seems the app doesn't switch environments. Because while I was using Sandbox, everything worked ok.
screenshot at nov 30 18-13-09

Update the logic to decide if it's an alert/background notification

We have a use case when we send a category in a silent push:

"aps" : {
  "category": "myCategory",
  "content-available" : 1
}

It may seem it doesn't make sense, but our logic uses this category to schedule a local notification later on. But the app sends an alert notification instead of a background one with the above payload. Will you update the logic to send a background notification in the above case?

Does allow to select a .p8 file

We need to be able to select a .p8 for iOS like the images suggest. It only allows me to select .p12 file which Apple does not provide.

Cut and Past

Is it my mini Mac m1 or is cut and paste disabled on your app? When entering a 40 character token that would be a lot of help!

Store auth details

Things like the Auth keypath, team id, key id, etc... are probably never going to change. Please save those across app launches so I don't have to look them up every time.

Cannot select .p8 token file

I have bought and download the app from the App Store
When I select iOS -> Token tab and click on the "SELECT P8" button nothing happens
What's wrong?

OS version: macOS Mojave 10.14.6

Stuck when loading

Hi!

I've a mac OS Mojave 0.14.6. I'm trying to send a notification in iOS with token, it's my first time using this tool but i thing it's all okey. After sending the notification, the loader is stuck and i don't receive the notification.

Thanks in advance.

CONTRIBUTING.md?

It would help if there were instructions on how to build this and contribute. I'm able to install this locally on my machine, but I don't know the steps to take to prepare this for release and submit a PR.

MacOS Mojave 10.14.5 support

The application cannot open on MacOS Mojave 10.14.5.

This is the log:

Process:               PushNotifications [20542]
Path:                  /Applications/PushNotifications.app/Contents/MacOS/PushNotifications
Identifier:            com.onmyway133.pushnotifications
Version:               1.4.0 (1.4.0)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           PushNotifications [20542]
User ID:               502

Date/Time:             2019-08-01 12:02:09.984 +0200
OS Version:            Mac OS X 10.14.5 (18F132)
Report Version:        12
Anonymous UUID:        55989678-FD7B-6530-036E-D4668C5D2EE9

Sleep/Wake UUID:       541A9102-DC0F-4D77-9A47-4DAAA363AB29

Time Awake Since Boot: 88000 seconds
Time Since Wake:       14000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x5] Code Signature

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: @rpath/Electron Framework.framework/Electron Framework
  Referenced from: /Applications/PushNotifications.app/Contents/MacOS/PushNotifications
  Reason: no suitable image found.  Did find:
	/Applications/PushNotifications.app/Contents/MacOS/../Frameworks/Electron Framework.framework/Electron Framework: code signature invalid for '/Applications/PushNotifications.app/Contents/MacOS/../Frameworks/Electron Framework.framework/Electron Framework'

	/Applications/PushNotifications.app/Contents/MacOS/../Frameworks/Electron Framework.framework/Electron Framework: stat() failed with errno=1

Binary Images:
       0x108f14000 -        0x108f14ff7 +com.onmyway133.pushnotifications (1.4.0 - 1.4.0) <F8DFE287-C6B4-3716-B3B3-CDF539205B40> /Applications/PushNotifications.app/Contents/MacOS/PushNotifications
       0x10fb6b000 -        0x10fbd56ef  dyld (655.1.1) <CE635DB2-D47E-3C05-A0A3-6BD982E7E750> /usr/lib/dyld
    0x7fff499d1000 -     0x7fff49adbfff  com.apple.Bluetooth (6.0.12 - 6.0.12f1) <58A607F0-A818-3535-A7BD-858D5BB0A807> /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth

Model: MacBookPro14,1, BootROM 194.0.0.0.0, 2 processors, Intel Core i5, 2,3 GHz, 8 GB, SMC 2.43f6
Graphics: kHW_IntelIrisGraphics640Item, Intel Iris Plus Graphics 640, spdisplays_builtin
Memory Module: BANK 0/DIMM0, 4 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C3531324D3332443250462D3039
Memory Module: BANK 1/DIMM0, 4 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C3531324D3332443250462D3039
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x170), Broadcom BCM43xx 1.0 (7.77.61.2 AirPortDriverBrcmNIC-1305.8)
Bluetooth: Version 6.0.12f1, 3 services, 27 devices, 1 incoming serial ports
Network Service: iPhone, Ethernet, en4
Network Service: Wi-Fi, AirPort, en0
USB Device: USB 3.0 Bus
USB Device: USB2.0 Hub
USB Device: iPhone
USB Device: USB 2.0 BILLBOARD
USB Device: USB3.0 Hub
USB Device: USB3.0 Card Reader
Thunderbolt Bus: MacBook Pro, Apple Inc., 41.1

Push not sent for iOS

Hey guys, trying to send pushes for iOS but I see a forever loading after clicking on Send button. It used to work fine before.

Thank you

How do I get the device token?

Every time I use the device token from either FCM or APNS it returns bad device token. Any detailed steps I can do to solve this?

High Sierra compatibility problem (empty UI)

After downloading the latest release (.zip archive, v.1.1.0) I launched the app. But it is absolutely empty. I suppose it's because I use macOS High Sierra and the app isn't adapted for that OS. Am I wrong? Can it be another issue?
screen shot 2017-10-12 at 16 30 21

Notifications not sent

Hi, this tools used to work fine but I haven't used it for a while until yesterday.
I tried it again and whenever I press "Send", I only see "Loading..." text and a progress bar. I left it there for about 5 minutes but still loading. I am using latest version and have all parameters entered. I am doing for Android btw.

Unable to send push notification with custom content

I am trying to send a push notification with the following body:
{"aps":
{"alert": {
"title": "Payment Late",
"body": "You have a payment that is late.",
}
},
"deeplink": "",
"userId": ""
}

however when I press send I just see "loading" and a spinning wheel. Is if it's possible to send an alert with a title and a body as well as a deeplink url?

Android: Bad Request

I'm trying to test the push notifications for the android application, but I see Failed: Bad Request. Can I get more information on why this happens? I use the server key and device token as in the description.

Android: Bad request

Hi,

May I ask what kinda of JSON we need to give for testing Android device.

I've tried:
{ "message":{ "token":"<my_device_token>", "notification":{ "title":"Portugal vs. Denmark", "body":"great match!" } } }
and some other simple ones, all return to me "Failed: Bad Request", but I could confirm my server key and device token are valid since I was able to sent from other online push notification tester.

Thanks.

Android mode only sends "data" portion of message, not "notification" {"title" and "body"}

Firebase messages can have both a data object and a notification object JSON data, but PushNotifications only sends the data object. The notification object should contain title and body so that in Android getNotification() returns these fields and not null. Example from https://firebase.google.com/docs/cloud-messaging/concept-options below.

{
"message":{
"token":"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
"notification":{
"title":"Portugal vs. Denmark",
"body":"great match!"
},
"data" : {
"Nick" : "Mario",
"Room" : "PortugalVSDenmark"
}
}
}

Voip Notification issue

hi i am facing issue in voip notification "Failed: InvalidPushType". I am working on iOS13 and Xcode 11.
Can you please add push type in UI. Actually PushType we need to add in header not in payload.

Failed: TopicDisallowed

Unable to push due to this error " Failed: TopicDisallowed " .

Here is my input:

{"aps":{"alert":"asda"}}

Wrong device token. iOS device token cannot contain special characters.

When entering a Firebase Cloud Messaging device token to send an iOS push notification I get this error:

Failed: Wrong device token. iOS device token cannot contain special characters. It must be a string with 64 hexadecimal symbols. Example: "03ds25c845d461bcdad7802d2vf6fc1dfde97283bf75cn993eb6dca835ea2e2f"

The FCM token is longer and has special characters. Does this mean this app doesn't work with FCM?

Unable to select a P8 file

On the latest release 1.7.4, when I try to upload a p8 file for authentication token for ios, the file select dialog opens, but nothing happens when I click on Open. The file is not selected.

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.