Skip to content

Service Modules and Vendors

Mat Hopwood edited this page Oct 2, 2020 · 11 revisions

IGX is designed in way that allows different portions of functionality provided by Facebook Instant Games (IG) to be replaced by different back-ends. At this moment in time the following service modules are available:

  • GameService - Provides basic initialisation for specific back-ends
  • StorageService - Provides access to server side data storage
  • UserService - Provides user login, registration, account management, profile access etc..
  • LeaderboardsService - Provides access to leaderboards
  • MessagingService - Provides access to user to user messages (this is not available in IG, but can be used to augment IG)
  • ReferralService - Provides access to referral code generation (this is not available in IG, but can be used to augment IG)
  • ShareService - Provides access to social sharing
  • AnalyticsService - Provides access to analytics
  • AdsService - Provides access to monetisation with adverts
  • PaymentsService - Provides access to monetisation with in-app purchases
  • ChatService - Provides access to user to user chat
  • DebugService - Provides on device console logging debugging

Each service module may have a variety of different back-ends that provide the actual implementation of the service. A back-end provider is called a vendor. For example, the AdsService can use the Unity, CrazyGames or GameDistribution vendors to provide the back-end functionality.

When creating the service module you can inform IGX which vendor you intend to use, e.g.:

new AdsService("crazygames");

or

new AdsService("gamedistribution");

Supported vendors

  • xtralife - Provides GameService, StorageService, UserService, LeaderboardsService, MessagingService, ReferralService
  • kongregate - Provides GameService, UserService, AnalyticsService, PaymentsService, ShareService, ChatService
  • crazygames - Provides AdsService
  • poki - Provides AdsService
  • swag - Provides StorageService, UserService, LeaderboardsService and limited AnalyticsService
  • gamedistribution - Provides AdsService
  • adinplay - Provides AdsService
  • google - Provides AnalyticsService
  • paypal - Provides PaymentsService
  • generic - Provides ShareService
  • unity - Provides GameService, StorageService, UserService, LeaderboardsService, AnalyticsService, PaymentsService, ShareService, DebugService

Additional vendors will be added over time.

Supported API's

Before you use functions within a service you should check that it is available. For example to query if it is safe to use FBInstant.shareAsync(), you can do the following:

if (FBInstant.getSupportedAPIs().includes("shareAsync"))
{
    // Safe to use
}

Help keep this project alive by donating paypal

Clone this wiki locally