Skip to main content

Starting Nuclei SDK

Launching Categories

The Nuclei SDK allows you to integrate different categories of services into your app, either via deeplinks or by using direct functions. Below are the instructions on how to use both approaches.


If you need to launch a category via a deeplink, use the following code snippet. Deeplinks allow you to direct users to specific sections of the app without needing to navigate through the UI.

import CoreAdapter

do {
// Example deeplink format: "gonuclei://gonuclei/recharge"
try CoreAdapterSetup.processDeeplink(deeplink: "<deeplink>")
} catch let error {
print("Error launching deeplink: \(error)")
}

Replace <deeplink> with the actual deeplink URL, such as "gonuclei://gonuclei/recharge" to open the recharge category.

2. Launching Nuclei Grid

If the partner is using Nuclei's grid, you can access the SDK's functionalities directly by launching explore method.

Launch Explore Section:

import CoreAdapter

do {
try CoreAdapterSetup.openExplore()
} catch let error {
print("Error opening Explore section: \(error)")
}

3. Launching Categories without Nuclei Grid

If the partner is not using Nuclei's grid and wants to access specific categories within their app, the following functions can be used to open different services directly.

info

Important: Always ensure that CoreAdapter is imported before using any of the functions below.

import CoreAdapter

Category Launch Functions:

Recharge:

do {
try CoreAdapterSetup.openRecharge()
} catch let error {
print("Error opening Recharge: \(error)")
}

DTH (Direct to Home):

do {
try CoreAdapterSetup.openDTH()
} catch let error {
print("Error opening DTH: \(error)")
}

Datacard:

do {
try CoreAdapterSetup.openDatacard()
} catch let error {
print("Error opening Datacard: \(error)")
}

Bill Payments:

do {
try CoreAdapterSetup.openBillPayments()
} catch let error {
print("Error opening Bill Payments: \(error)")
}

Cabs:

do {
try CoreAdapterSetup.openCabs()
} catch let error {
print("Error opening Cabs: \(error)")
}

Flights:

do {
try CoreAdapterSetup.openFlight()
} catch let error {
print("Error opening Flights: \(error)")
}

Credit Score:

do {
try CoreAdapterSetup.openCreditScore()
} catch let error {
print("Error opening Credit Score: \(error)")
}

Gift Cards:

do {
try CoreAdapterSetup.openGiftCard()
} catch let error {
print("Error opening Gift Cards: \(error)")
}

Hotels:

do {
try CoreAdapterSetup.openHotel()
} catch let error {
print("Error opening Hotels: \(error)")
}

Bus:

do {
try CoreAdapterSetup.openBus()
} catch let error {
print("Error opening Bus: \(error)")
}

Events:

do {
try CoreAdapterSetup.openEvents()
} catch let error {
print("Error opening Events: \(error)")
}

Gold Subscription:

do {
try CoreAdapterSetup.openGoldSubscription()
} catch let error {
print("Error opening Gold Subscription: \(error)")
}

Donations:

do {
try CoreAdapterSetup.openDonations()
} catch let error {
print("Error opening Donations: \(error)")
}

Customer Support:

do {
try CoreAdapterSetup.openCustomerSupport()
} catch let error {
print("Error opening Customer Support: \(error)")
}

Synapse:

For launching Synapse with a merchant-specific payload:

do {
try CoreAdapterSetup.openSynapse(synapseActiveMerchantPayload: DeeplinkType.SynapseMerchantDeeplink.rawValue)
} catch let error {
print("Error opening Synapse: \(error)")
}

My Transactions:

do {
try CoreAdapterSetup.openMyTransaction()
} catch let error {
print("Error opening My Transactions: \(error)")
}

Car Rental:

do {
try CoreAdapterSetup.openCarRental()
} catch let error {
print("Error opening Car Rental: \(error)")
}

Gaming Vouchers:

do {
try CoreAdapterSetup.openGamingVouchers()
} catch let error {
print("Error opening Gaming Vouchers: \(error)")
}

Key Notes:

  • Error Handling: Always handle errors gracefully when opening different categories. The SDK functions throw errors, so make sure to catch and log them for easier debugging.
  • Import CoreAdapter: Ensure you import CoreAdapter at the top of your file when working with any of these functions or deeplinks.
  • Deeplink Format: The typical deeplink format is gonuclei://gonuclei/<category>, where <category> is one of the supported categories (e.g., recharge, flights).