Plugin for integrate data over sound SDK Chirp.io into Unity project. Support iOS and Android projects. For more information see Chirp documentation.
For setup plugin you will need to
- Import
UnityChirpIOPlugin.unitypackage
(download) into your Unity project. - Sign up at developers.chirp.io and download the latest Android and iOS SDK from downloads.
- Copy the
chirpsdk-release.aar
file into theChirpIO/Plugins/Android
folder of the Unity project. - Copy the
ChirpConnect.framework
file into theChirpIO/Plugins/iOS
folder of the Unity project. - Copy your app key, secret and config into TestPlugin script fields on ChirpGO game object in ChirpIOExampleScene scene.
For Android build you will need to
- Set
Minimum API Level
to level 19 or higher
For iOS build you will need to
- Go
Edit\Project Settings\Audio
checkDisable Unity Audio
. CauseDeactivating an audio session that has running I/O
issue. - Go iOS Player Settings and define
Microphone Usage Description
. - In XCode project set
Enable Bitcode: NO
. - Replace
@import AudioToolbox; @import Foundation;
to#import "AudioToolbox/AudioToolbox.h" #import "Foundation/Foundation.h"
inChirpConnect.h
file insideChirpConnect.framework
.
At moment plugin allow send and receive string data over sound, see example scene. This plugin not full implement SDK features. If you need more features, you can create issue, also feel free to contribute.
ChirpPlugin
is static class for work with ChirpSDK.
Method for initialize SDK with given key, secret and config.
ChirpPlugin.InitSDK(string key, string secret, string config)
Method for start SDK work.
ChirpPlugin.StartSDK()
Method for stop SDK work.
ChirpPlugin.StopSDK()
Method for send given string data.
ChirpPlugin.SendData(string payload)
Current SDK state property.
ChirpStateEnum ChirpPlugin.ChirpState
Action delegate for state change handling.
Action<ChirpStateEnum, ChirpStateEnum> ChirpPlugin.OnChangeStateDataEvent
Action delegate for receive data handling. Data in HEX string format!
Action<string> ChirpPlugin.OnRecieveDataEvent
Action delegate for sent data handling. Data in HEX string format!
Action<string> ChirpPlugin.OnSentDataEvent
For testing data receiving you can use Chirp Audio API. Use your developer key and secret for auth. Send Hello world! by standart protocol.
Plugin source code for iOS it's just Objective-C++ files in Plugins folder, you don't need to build it.
Plugin source code for Android it's Gradle project.For a correct build you must place chirpsdk-release.aar
to unitychirpio/libs
and build unitychirpio
module by Gradle.