SShortSingh.
Back to feed

Testing iOS Push Notifications on a Real Device with APNs and Node.js

0
·2 views

The iOS Simulator cannot catch production push problems because it never contacts Apple's servers, so a real device is needed for accurate testing. The guide explains how to enable the Push Notifications capability in Xcode and log the device token from the app. It warns that tokens from Xcode builds are sandbox tokens while TestFlight and App Store builds use production tokens, a common cause of push failures. It also describes creating an APNs .p8 authentication key in the Apple Developer account, noting that the key does not expire and that the environment choice cannot be changed later. Finally, it shows how to structure a JSON payload and send it through APNs using a short Node.js script with HTTP/2 and a signed JWT.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

PS4 Pro DDR3 Read Speed Raised From 10.6 MB/s to 504 MB/s via DMA Patch

A developer working on Linux for the PS4 Pro found that reads from its DDR3 memory were capped near 10.6 MB/s because the CPU fetched data in tiny 8-byte chunks through a narrow PCI window. The chip's southbridge contains a DMA engine that could handle the transfers, but no Linux driver existed for it, and Sony's gameOS driver is closed-source. The developer reverse-engineered the kernel binary to recover the chip's address mapping and the DMA command sequence. A patch was then built that binds the engine as a PCI device and routes transfers through a coherent buffer allocated at startup. Reported results show reads improving to about 504 MB/s and writes to about 425 MB/s, with the engine capable of roughly 1.4 GB/s.

0
ProgrammingDEV Community ·

Mozjpeg Gives Smaller White-Background JPEGs With Fewer Off-White Pixels Than Pillow or Sharp

A developer compared Pillow, sharp, and sharp with its mozjpeg option for saving white-background product photos as JPEG. Pillow and default sharp produced identical pixels, while the mozjpeg flag yielded smaller files with fewer stray non-white background pixels at the same quality. None of the encoders kept the background at a pure 255 value across every pixel. The tests were run on three Wikimedia Commons photos using an Apple M4 Mac with Pillow 11.3.0 and sharp 0.34.5. The author found mozjpeg at quality 85 with 4:4:4 sampling roughly matched Pillow at quality 95 in stray-pixel share while using less than half the bytes.

0
ProgrammingDEV Community ·

Why browser extension UIs break on many sites and how a Shadow DOM wrapper fixes it

Badges injected by browser extension content scripts often render incorrectly on real websites, appearing oversized, misplaced, or missing controls. The problem stems from aggressive global CSS resets, utility classes, and broad element selectors on supermarket web shops that leak into extension widgets. The author, while building the open-source ShrinkWatch EU extension, found a fix by placing the widget inside a Shadow DOM with a reset host element and self-contained styles. The approach also recommends fixed pixel units instead of rem, and attaching the host to the document root so page navigation or body transforms do not disrupt its positioning. The author reports that since version 0.3.2 the badge has looked consistent across the shops tested in a real browser.

0
ProgrammingDEV Community ·

Keeping Telegram Inline Keyboard Callbacks Within Limits in PHP

Telegram bots that use inline keyboards for approval or routing workflows often break in production. Telegram enforces a 64-byte limit on callback_data, and oversized payloads can cause keyboards to fail silently or trigger API errors. Another common problem is failing to call answerCallbackQuery promptly, which leaves the client showing a loading spinner until it times out. The article recommends short, compact payload formats instead of embedding full context in buttons. It also proposes a dedicated cURL-based Telegram client that checks HTTP codes and error responses, rather than relying on file_get_contents.