datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
272 stars 229 forks source link

Android Notification is not displayed #76

Closed robertstrz closed 6 years ago

robertstrz commented 6 years ago

Hello, I am using the following configuration from docs, but after running application I don't see any notification. Android 6.0.1 Nexus 5

    let notificationConfiguration = {
        service: {
            ua: Platform.select({ios: "Reachify iOS", android: "Reachify Android"}), // Default: React Native PjSip (version)
            notifications: {
                account: {
                    title: "My cool react native app", // Default: account name
                    text: "Here we go",
                    info: null,
                    ticker: null,
                    smallIcon: null,
                    largeIcon: null
                },
                call: {
                    title: "Active call",
                    text: "John Doe",
                    info: null,
                    ticker: null,
                    smallIcon: null,
                    largeIcon: null
                }
            }
        },
        network: {
            useAnyway: true,
            useWifi: true,
            use3g: true,
            useEdge: true,
            useGprs: true,
            useInRoaming: true,
            useOtherNetworks: true
        }
    };

    let endpoint = new Endpoint();
    let state = await endpoint.start(notificationConfiguration);
datso commented 6 years ago

Hello, sorry the docs are outdated, current version doesn't have this functionality because it is not possible to make it cross platform. Consider using push notifications instead of background connection to the SIP server.

robertstrz commented 6 years ago

I would like to be able to send those notification even when someon killed the app. Could you please tell me what would be the best approach for that ?