#

SUD

loadMG API

  • Languages
    • Format: language code (lowercase letters)-country/region code (uppercase letters)
    • Example: zh-CN, en-US, and af-ZA

Android

public interface ISudFSTAPP {

    /**
     * Obtain the game view information.
     * @return
     */
    View getGameView();

    /**
     * Destroy game.
     * @return
     */
    boolean destroyMG();

    /**
     * Update code.
     * @param code
     * @param listener
     */
    void updateCode(String code, ISudListenerNotifyStateChange listener);

    /**
     * Notify the game of the app state.
     * @param state
     * @param dataJson example: {"key": "value"}
     */
    void notifyStateChange(String state, String dataJson, ISudListenerNotifyStateChange listener);

    /**
     * Start game.
     */
    void startMG();

    /**
     * End game.
     */
    void stopMG();

    /**
     * Continue game.
     */
    void playMG();

    /**
     * Pause game.
     */
    void pauseMG();

    /**
     * The incoming audio slices must be in the PCM format, and be recorded with a sample rate of 16,000 Hz and a bit depth of 16-bit. The number of channels must be monophonic. 
     * The length of audio slices can be adjusted according to the effect. Larger length: good accuracy but long delay. Smaller length: short delay but sacrifice accuracy.
     */
    void pushAudio(ByteBuffer data, int dataLength);

    /**
     * Game failed to load, reload
     */
    void reloadMG();
}

iOS

@protocol ISudFSTAPP <NSObject>

/// Obtain the game view information.
/// @return UIView
- (UIView *)getGameView;

/// Destroy game.
/// @return boolean
- (bool)destroyMG;

/// Update the short-term token code.
/// @param code Short-term token code.
/// @param listener The callback indicates that the game has received the app state rather than processed other logic codes, such as network request. Generally, the callback returns NULL.
- (void)updateCode:(NSString *) code listener:(ISudListenerNotifyStateChange) listener;

/// Notify the game of the app state.
/// @param state state
/// @param dataJson example: {"key": "value"}
/// @param listener The callback indicates that the game has received the app state rather than processed other logic codes, such as network request. Generally, the callback returns NULL.
- (void)notifyStateChange:(const NSString *)state dataJson:(NSString *)dataJson listener:(ISudListenerNotifyStateChange) listener;

/// Continue game.
- (void) playMG;

/// Pause game.
- (void) pauseMG;

/// The incoming audio slices must be in the PCM format, and be recorded with a sample rate of 16,000 Hz and a bit depth of 16-bit. The number of channels must be monophonic. 
/// The length of audio slices can be adjusted according to the effect. Larger length: good accuracy but long delay. Smaller length: short delay but sacrifice accuracy.
/// @param data PCM data.
- (void)pushAudio:(NSData *)data;
@end

/// Game failed to load, reload
- (void)reloadMG;

Web

interface ISudFSTAPP {

  /**
   * Get game view
   * @return
   */
  getGameView();

  /**
   * Destroy game
   * @return
   */
  destroyMG(): boolean;
  /**
   * Update code
   * @param code
   * @param listener
   */
  updateCode(code: string, listener: ISudListenerNotifyStateChange): void;

  /**
   * Notify app state change to mini game
   * @param state
   * @param dataJson example: {"key": "value"}
   */
  notifyStateChange(
          state: string,
          dataJson: string,
          listener: ISudListenerNotifyStateChange
): void;

  /**
   * Game loading failed, reload
   */
  reloadMG(): void;
}

results matching ""

    No results matching ""