Show Gameball User Profile

Show your user's profile including all details, user challenges, and the leaderboard on React-native app.

Gameball’s views are accessible through the code below. Note the you must first register your API Key and a player before accessing the views.

First import Gameball Player Profile widget.

import {GameballWidget} from 'react-native-gameball';

There are two ways to view the widget.

Show as standalone screen

<GameballWidget />

Show as Modal

<GameballWidget 
  modal={true}
/>

and then to open the widget you need to call the openWidget function on the ref property of the widget

Example on running the widget as a Modal:

return (
      <View style={{ flex: 1 }}>
        <Button
          title={'open widget'}
          onPress={() => this.widget.openWidget()}
        />
        <GameballWidget
          ref={(ref) => this.widget = ref}
          modal={true}
        />
      </View>
)

Last updated