Skip to content

adelabd/cordova-plugin-search-ads

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-search-ads

A apple search ads attribution plugin for cordova

Supported Platforms

  • iOS

Types

interface Cordova {
	plugins: CordovaPlugins;
}

interface CordovaPlugins {
	SearchAds: ISearchAdsPlugin;
}

/**
 * See:
 * https://developer.apple.com/documentation/iad/setting_up_apple_search_ads_attribution?language=objc
 * https://developer.apple.com/documentation/ad_services?language=objc
 */
interface ISearchAdsAttributionPayload {
	[key: string]: string | number | boolean;
}

interface ISearchAdsError {
	/**
	 * error code , see https://github.com/apple/swift/blob/3a75394c670bb7143397327ac7bf5b5fe8d50588/stdlib/public/SDK/Foundation/NSError.swift#L642
	 */
	code?: string;
	/**
	 * relevant only for unexpected flow
	 */
	reason?: string;
	/**
	 * localized description from error, for example: The Internet connection appears to be offline.
	 */
	localizedDescription?: string;
}

/**
 * Return ISearchAdsAttributionPayload
 * Error: ISearchAdsError
 */
interface ISearchAdsPlugin {
	requestAttributionDetails(): Promise<ISearchAdsAttributionPayload>;
}

Example

cordova.plugins.SearchAds.requestAttributionDetails()
    .then((payload: ISearchAdsAttributionPayload) => console.log(payload))
    .catch((error?: any) => console.error(error));

About

A apple search ads attribution plugin for cordova

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 93.0%
  • JavaScript 7.0%