Show Gameball Player Profile
Show your user's profile including all details, user challenges, and the leaderboard on React-native app.
Using the SDK, you can open the Gameball player profile from a button in your app, programmatically when someone does something, or from a persistent button that sits over your app’s UI.
When you trigger the Gameball player profile, your player is presented with a home screen. This is configurable inside Gameball to change how it looks and what’s presented.
From there, your player can check his progress across different Gameball programs as per your configurations.
To show the Gameball player profile that contains the user details, user challenges, and the leaderboard use the below steps.
1
import {GameballWidget} from 'react-native-gameball';
Copied!
There are two ways to view the widget.

Show as standalone screen

1
<GameballWidget />
Copied!

Show as Modal

1
<GameballWidget
2
modal={true}
3
/>
Copied!
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:
1
return (
2
<View style={{ flex: 1 }}>
3
<Button
4
title={'open widget'}
5
onPress={() => this.widget.openWidget()}
6
/>
7
<GameballWidget
8
ref={(ref) => this.widget = ref}
9
modal={true}
10
/>
11
</View>
12
)
Copied!

Last modified 2mo ago