Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events not firing in android 10 in react-native 0.61.5 #54

Open
axeljeremy7 opened this issue Mar 9, 2020 · 6 comments
Open

events not firing in android 10 in react-native 0.61.5 #54

axeljeremy7 opened this issue Mar 9, 2020 · 6 comments

Comments

@axeljeremy7
Copy link

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!
@Manish-Lakra
Copy link

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

@axeljeremy7
Copy link
Author

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.

@jawwad22
Copy link

jawwad22 commented Sep 1, 2020

have found the solution?

@uwtechexpert
Copy link

uwtechexpert commented Sep 2, 2020 via email

@Balthazar33
Copy link

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?

@kaylabee02
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants