Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Subscriptions (C compatible)

Ahmed Castro edited this page Jun 22, 2018 · 11 revisions

modioSubscribeToMod

void modioSubscribeToMod(void* object, u32 mod_id, void (*callback)(void* object, ModioResponse response, ModioMod mod));

Wrapped by: Subscriptions#subscribetomod

API endpoint used: Subscribe to Mod

Subscribe the authenticated user to a corresponding mod.

Function parameters

Name Type Description
object void* Context parameter.
mod_id u32 Mod's unique identifier.
callback void (*callback)(void* object, ModioResponse response, ModioMod mod) Function called once the process finished.

Callback parameters

Name Type Description
object void* Context parameter.
response ModioResponse ModioResponse object that contains the mod.io response status.
mod ModioMod ModioMod object the user just subscribed to.

Example

void onSubscribeToMod(void* object, ModioResponse response, ModioMod mod)
{
  if(response.code == 201)
  {
    //Subscribed to mod successfully
  }
}

[...]

modioSubscribeToMod(NULL, mod_id, &onSubscribeToMod);

modioUnsubscribeFromMod

void modioUnsubscribeFromMod(void* object, u32 mod_id, void (*callback)(void* object, ModioResponse response));

Wrapped by: Subscriptions#unsubscribefrommod

API endpoint used: Subscribe from Mod

Unsubscribe the authenticated user from the corresponding mod.

Function parameters

Name Type Description
object void* Context parameter.
mod_id u32 Mod's unique identifier.
callback void (*callback)(void* object, ModioResponse response) Function called once the process finished.

Callback parameters

Name Type Description
object void* Context parameter.
response ModioResponse ModioResponse object that contains the mod.io response status.

Example

void onUsubscribeFromMod(void* object, ModioResponse response)
{
  if(response.code == 204)
  {
    //Unsubscribed from mod successfully
  }
}

[...]

modioUnsubscribeFromMod(NULL, mod_id, &onUsubscribeFromMod);

Contents

Clone this wiki locally