Skip to content

Add Option for Bundle Identifier header for restricting access #77

@ShadyH20

Description

@ShadyH20

I have a Google API key that is restricted to only an iOS app with a specific bundle identifier.
For that key to work, the GET request to the API needs to include this header x-ios-bundle-identifier as mentioned in this StackOverflow comment

Here is the place in the code where you can add this
Image

Something like this:

Map<String, String> headers = {};
if (defaultTargetPlatform == TargetPlatform.iOS) {
  headers['x-ios-bundle-identifier'] = "com.example.app";
}
Response response =
    await _dio.get(url, options: Options(headers: headers));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions