DEV Community

Cover image for Push notification
Salvo One thousand
Salvo One thousand

Posted on

Push notification

Hello,

I have an android app created using react. The app contains a wordpress web site and enable push notification on mobile device. A push notification is generated on device when an article is published.

The app works but, starting from a specific moment (maybe after a wordpress core upgrade), the push notifications doesn't work anymore.

I didn't develop the app and I'm noto an expert in mobile app developing but I have the source code of the package.

Someone can help me understanding and repair?

Furthermore I don't know how to test the mobile app to verify the app behaviour in a virtual dev environmet.

Following the libraries used in the mobile app:

App.js:
import React, { useEffect, useState } from "react";
import {SafeAreaView, StyleSheet, View} from "react-native";
import messaging from "@react-native-firebase/messaging";
import analytics from "@react-native-firebase/analytics"
import { NativeBaseProvider } from "native-base/src/core/NativeBaseProvider";
import RNBootSplash from "react-native-bootsplash";
import AppWebView from "./components/AppWebView";
import {configureNotifs, LocalNotification} from "./notifications/LocalPushController";

LocalPushController.js:
import PushNotification, {Importance} from 'react-native-push-notification'

In wordpress function.php file I have:
add_action('rest_after_insert_post', 'test' , 10, 3)
and the fuction that sends a rest call:
function test($post, $request, $creating = true)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay