react-native-boundary icon indicating copy to clipboard operation
react-native-boundary copied to clipboard

events not firing in android 10 in react-native 0.61.5

Open axeljeremy7 opened this issue 4 years ago • 6 comments

Code I use:

import React from 'react'
import {Component} from 'react';
import {
    View, Text, Dimensions,
} from 'react-native';
import Boundary, {Events} from 'react-native-boundary';

const {height} = Dimensions.get('window');

export default class Home extends Component {
    constructor(props) {
        super(props);

        this.state = {
            onEnter: false,
            onExit: false,
        };
    }

    componentDidMount() {
        console.log({state: this.state});
        Boundary.add({
            lat: 42.285232,
            lng: -85.626622,
            radius: 50, // in meters
            id: "Station",
        })
            .then(() => console.log("success!"))
            .catch(e => console.error("error :(", e));

        Boundary.on('onEnter', id => {
            this.setState(prev => ({...prev, onEnter: true}));
            console.log(`ON ENTER ${id}!!`);
        });

        Boundary.on('onExit', id => {
            this.setState(prev => ({...prev, onExit: true}));
            console.log(`ON EXIT ${id}!!`)
        });
    }

    componentWillUnmount() {

        // Remove the events
        Boundary.off(Events.ENTER);
        Boundary.off(Events.EXIT);

        Boundary.remove('Station')
            .then(() => console.log('Goodbye Station :('))
            .catch(e => console.log('Failed to delete Station :)', e))
    }

    render() {
        return (
            <View style={{
                backgroundColor: '#EAF0F6',
                height: height,
                justifyContent: 'flex-start',
                alignItems: 'flex-start',
            }}>
                <Text style={{fontSize: 18, color: '#707070'}}>{JSON.stringify(this.state)}</Text>
            </View>
        );

    }
}

the logs i only get.

 LOG  {"state": {"onEnter": false, "onExit": false}}
 LOG  Goodbye Station :(
 LOG  success!

axeljeremy7 avatar Mar 09 '20 20:03 axeljeremy7

Facing the same. Did you able to resolve it ? @axeljeremy7 axeljeremy7

Manish-Lakra avatar Jun 29 '20 09:06 Manish-Lakra

Facing the same. Did you able to resolve it ? @axeljeremy7 axeljeremy7

Sadly not, I just create a new functionality with the background location to simulate this.

axeljeremy7 avatar Jun 29 '20 23:06 axeljeremy7

have found the solution?

jawwad22 avatar Sep 01 '20 15:09 jawwad22

Hi Guys,

I am able to run it on Android 10 with API 29, it creates problem with API 30. I have tested it.

Thanks,

On Sep 1, 2020, at 11:18 AM, jawwad22 [email protected] wrote:

have found the solution?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/eddieowens/react-native-boundary/issues/54#issuecomment-684932169, or unsubscribe https://github.com/notifications/unsubscribe-auth/APQIO5IFV5IEAMDDZOB7ARTSDUGFLANCNFSM4LEQUGXQ.

uwtechexpert avatar Sep 02 '20 03:09 uwtechexpert

Hi Guys, I am able to run it on Android 10 with API 29, it creates problem with API 30. I have tested it. Thanks, On Sep 1, 2020, at 11:18 AM, jawwad22 @.***> wrote: have found the solution? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#54 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/APQIO5IFV5IEAMDDZOB7ARTSDUGFLANCNFSM4LEQUGXQ.

Can you share your code, please?

Balthazar33 avatar Apr 13 '21 15:04 Balthazar33

Hi Guys, I am able to run it on Android 10 with API 29, it creates problem with API 30. I have tested it. Thanks, On Sep 1, 2020, at 11:18 AM, jawwad22 @.***> wrote: have found the solution? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#54 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/APQIO5IFV5IEAMDDZOB7ARTSDUGFLANCNFSM4LEQUGXQ.

anyone found solution with this?

kaylabee02 avatar Jul 01 '21 02:07 kaylabee02