In this section you will find the necessary information to enable your app to detect and react to Bidco tags.

Merchants use the Bidco Merchant API to generate tags for their products, catalogs, coupons and Acts and then place the tags on their eCommerce sites and in printed media for their customers to interact with.

Once implemented, your app will be able to retrieve the workflows associated with these tags.

The tag types currently supported are:

  • Barcode - A QR code that has been encoded with the information needed to retrieve a workflow.
  • Touch To Buy - When viewing a merchants eCommerce site on a Mobile device a button is visible instead of a QR code. This button is used to retrieve the workflow.

Detecting Barcode Tags


  1. Add the PTKBarcodeTagDetectorView to your ViewController, drop new View onto your controller, open the identity inspector and set the custom class to "PTKBarcodeTagDetectorView"

barcodeDetectorView


  1. Implement the PTKBarcodeTagDetectorViewDelegate in your ViewController:
- (void)barcodeTagDetectorView:(nonnull PTKBarcodeTagDetectorView *)barcodeTagDetectorView
		didDetectBarcode:(nonnull PTKTag *)tag
		image:(nonnull UIImage *)image
	barcodeRegion:(nonnull NSArray *)barcodeRegion
	{
		// Stop detection
		[self.detectorView stopDetection];
		// Process tag
		[self processTag:tag];
	}

	- (void)barcodeTagDetectorView:(nonnull PTKBarcodeTagDetectorView *)barcodeTagDetectorView
	didDetectNonPowaTagBarcode:(nonnull PTKBarcode *)barcode
		image:(nonnull UIImage *)image
		barcodeRegion:(nonnull NSArray *)barcodeRegion
	{
		// Stop detection and show error.
	}

	- (void)barcodeTagDetectorViewDidStart:(nonnull PTKBarcodeTagDetectorView *)barcodeTagDetectorView
	{
		// Detector started.
	}

	- (void)barcodeTagDetectorView:(nonnull PTKBarcodeTagDetectorView *)barcodeTagDetectorView
	didStopWithError:(nullable NSError *)error
	{
		// Detector stopped handle error if present.
	}

  1. Set the delegate when your controller loads:
- (void)viewDidLoad
  {
     self.barcodeTagDetectorView.delegate = self;
  }

  1. Call startDetection and stopDetection from appropriate lifecycle methods in your ViewController:
- (void)viewDidAppear
  {
	[self.barcdeTagDetectorView startDetection];
  }

- (void)viewDidDisappear
  {
	[self.barcodeTagDetectorView stopDetection];
  }

  1. To check if the audio tag detector is actively listening for tags use:
- (void)myMethod
  {
	if ([self.detectorView isDetecting]) {
		// detecting
	} else {
		// not detecting
	}
  }

Detecting "Touch to Buy" Tags


  1. Add the following to the plist file:
<intent-filter>
	<action android:name="android.intent.action.VIEW" />

	<category android:name="android.intent.category.DEFAULT" />
	<category android:name="android.intent.category.BROWSABLE" />

	<data android:host="powat.ag"
		  android:scheme="bidcodemo" />
</intent-filter>

Note: An example scheme is being implemented here. This should be replaced with the scheme you are using.


  1. Create an instance of the AppLinkTagDetector:
- (BOOL)application:(UIApplication )application handleOpenURL:(NSURL )url
{
	NSError *error;
	PTKAppLink *tagDetector = [PTKAppLinkTagDetector detectAppLinkWithURL:url  error:&error];
	if (tagDetector) {
		[self processTag:tagDetector.labelTag];
	} else {
		// invalid tag  error.
	}
}

Next Steps


Use the Bidco tag to retrieve the associated workflow.


Sample


To explore this topic in more detail, including package imports and trigger implementation, import the sample app.