🚀
Import SDK
Unity
Cordova
Javascript
iOS
GameMaker
- 1.
- 2.Download Galaxy.unitypackage and import it (double click the unitypackage file when your project is open or choose Assets > Import Package > Custom Package...)
- 3.In the menu bar, choose GalaxySDK > Open GalaxySDK Settings. In the Inspector, add your Publishable Key found in settings in the dashboard.
AndroidManifest.xml: If you already have an AndroidManifest.xml (or another plugin that causes issues with it), delete /Assets/GalaxySDK/Editor/ModifyUnityAndroidAppManifest.cs
Then add the following line to AndroidManifest.xml manually:
<uses-permission android:name="android.permission.READ_CONTACTS" />
This allows the user to sync their contacts to find their friends, if they elect to. Contacts are never requested without opt-in from the user.
- 1.Run
cordova plugin add cordova-plugin-galaxy
- 2.window.galaxy.InitSDK({publishableKey: 'Your Galaxy Publishable Key',}, (result) => { }, (error) => { });
- 3.
<html>
<head>
<script src="https://galaxy.us/galaxy.js"></script>
</head>
<body>
<script>
window.galaxy.InitSDK({
publishableKey: 'Your Galaxy Publishable Key',
}, (result) => {
console.log(result);
}, (error) => {
console.error(error);
});
</script>
</body>
</html>
- 1.Setup Cocoapods in your project and add the following to your Podfile:
pod 'GalaxySDK'
- 2.Run
pod install
- 3.In your AppDelegate.swift add the import statement and
configure
call:
import UIKit
import GalaxySDK
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
GalaxySDK.shared.configure(publishableKey: "your publishable key")
return true
}
...
}
- 4.In Xcode open your app target, select the Info tab, and add NSContactsUsageDescription as a key. For its value, add whatever you want or use this template: "Allow access to your contacts to find friends who also play {your game}"
Contacts: You must add the NSContactsUsageDescription to your Info.plist or the app will crash when the SDK asks for permission to access contacts. If you want to disable this feature, you can do so in your dashboard settings.
- 1.
- 2.Set the publishable key in the extension options
- 3.Authenticate the user with
Galaxy_Authenticate()
Custom ID: If you have your own ID for each player, you can call
Galaxy_Authenticate(your_player_id)
instead.- 4.(optional) Set the default leaderboard ID
Then, import the namespace at the top of all files that will interact with Galaxy like so:
using GalaxySDK;
Last modified 3mo ago