This is a demo application that demonstrate how to use BPC SDK along with ATOM SDK
BPC SDK provides the customizable inventory which enables you to offer different sets of entities to your end-users with the help of customized Packages and Groups. BPC SDK will also provide Custom Attributes that you can associate with every byte of system related data e.g. Countries data is Atom's property but through BPC, you can add Custom Attributes to Country's object like flag icon etc which enables to stay back-end-free and BPC will serve as your customized back-end.
- How to get Inventory filtered by Packages
- Some frequently used methods present in the SDK
- Compatible with Microsoft Visual Studio 2015 and onwards
- Minimum .Net Framework 4.5 required
- Compatible with ATOM SDK Version 2.2.1 and onwards
Install the latest version of Atom Windows BPC SDK through NuGet.
Install-Package Atom.BPC.Net -Version 1.6.0
ATOM BPC SDK offers a feature to enable the local inventory support. This can help Application to fetch Inventory even when device network is not working or in areas where there are URL blockages.
- To enable it, just start demo application with your Secret Key for the first time.
- A database file (.sdf) will be generated right at the executable directory.
- File name should be localdata.sdf. Please rename the file to localdata.sdf if you find any discrepancy in the file name.
- Make that database (.sdf) file the part of your package and it should be placed where BPC Dlls are placed (usually it is your installation directory).
BPC SDK needs to be initialized with a “SecretKey” provided to you after you buy the subscription which is typically a hex-numeric literal.
var atomConfiguration = new AtomConfiguration(“SECRETKEY_GOES_HERE”);
var bpcManager = await AtomBPCManager.InitializeAsync(atomConfiguration);
Please note that another Initializer is available with a callback functionality. Explore more in inline documentation.
BPC enables you to define and sell your customers your own choice of inventory by creating packages. Through BPC SDK, you can get complete inventory as well as get it filtered by your logged in customer's package. Following are some code examples to achieve the same:
Call this method to get all packages from your inventory
var packages = await bpcManager?.GetPackages();
This function will retrieve all countries that are associated with a particular package
var countries = await bpcManager?.GetCountriesByPackage(PackageObject);
This function will retrieve all protocols that are associated with a particular package
var protocols = await bpcManager?.GetProtocolsByPackage(PackageObject);
This function will provide the list of all countries present in your inventory
var countries = await bpcManager?.GetCountries();
This function will provide the list of all physical countries present in your inventory
var countries = await bpcManager?.GetPhysicalCountries();
This function will provide the list of all virtual countries present in your inventory
var countries = await bpcManager?.GetVirtualCountries();
It can be determined by IsVirtual property of country
var country = countries.FirstOrDefault();
var isVirtualCountry = country.IsVirtual;
var isPhysicalCountry = !country.IsVirtual;
This function will provide latency for countries and returns sorted collection in ascending order of measured latencies
var countries = await bpcManager?.GetCountries();
var pingedCountries = await countries?.PingAsync();
This function will provide you the list of countries that are mapped with a specific protocol
var countries = await bpcManager?.GetCountriesByProtocol(protocolObject);
List of supported features (e.g. p2p) for a country can be obtained from SupportedFeatures property
var country = countries.FirstOrDefault();
List<string> countryFeatures = country.SupportedFeatures;
This function will provide the list of all cities present in your inventory
var cities = await bpcManager?.GetCities();
This function will provide you the list of cities that are mapped with a specific protocol
var cities = await bpcManager?.GetCitiesByProtocol(protocol)