override_api_endpoint

Last updated:

0 purchases

override_api_endpoint Image
override_api_endpoint Images
Add to Cart

Description:

override api endpoint

override_api_endpoint #


Overrides and persists default API endpoint for the test environment.

deeplinkOverrideSegment - part of deeplink that uniquely
identifies deeplink that is used to override API endpoint
eg. override in app://app/override?apiAddress=https%3A%2F%2Fexample.com
deeplinkQueryParameter - query parameter of the override API
endpoint deeplink that contains url encoded API endpoint to be used
eg. apiAddress in app://app/override?apiAddress=https%3A%2F%2Fexample.com
defaultEndpoint - fallback URL that should be used if app does not
have any endpoint introduced via deeplink or if deeplinkQueryParameter is
not provided

Usage #
import 'package:shared_preferences/shared_preferences.dart';
import 'package:uni_links/uni_links.dart';

final apiEndpoint = await overrideApiEndpoint(
sharedPreferences: await SharedPreferences.getInstance(),
getInitialUri: getInitialUri,
deeplinkOverrideSegment: 'override',
deeplinkQueryParameter: 'apiAddress',
defaultEndpoint: Uri.parse('https://api.example.com'),
);
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.