如何使用Passslot向pass中添加值? [英] How can I add values to the pass using Passslot?

查看:267
本文介绍了如何使用Passslot向pass中添加值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程式中整合



在我的应用程序中,我使用上面的模板和一个带有值的字典创建了pass,

  NSDictionary * values = [NSDictionary dictionaryWithObjectsAndKeys:
@14,@gate,
@India离开,
@UAE,@到达,
@2:25 PM,@boardingTime,
@Air India,@flightNewName b $ b @first,@class,
@7/22,@date,
@name,@passenger,nil];

[PassSlot createPassFromTemplateWithName:@SamplewithValues:values andRequestInstallation:self completion:^ {
NSLog(@Created);
}];

传递已创建,但传递的值不在传递中。它显示通行模板中的默认值。





我传递字典输入中的值。为什么它不来?



如何解决?请指导我。

解决方案

为了让PassSlot能够显示您提供的数据,您需要告诉系统



为此,我们有所谓的占位符系统。它允许您定义任何数量的数据字段,称为占位符,可以在创建传递过程中提供。



创建占位符的最简单的方法,系统在哪里显示数据是通过在模板上写 $ {< placeholder>}的名称。这将自动为您创建一个文本占位符。



为了使您提供的门 14 出现在通行证的右上角,用 $ {gate} 替换模板上的 23



占位符非常灵活,可以在任何地方(条形码,背面和非可见部分)使用它们,您还可以在每个字段中有多个占位符(例如,您可以 PASSENGER $ {firstName} $ {lastName} )。
占位符也可以具有不同的类型,然后是高级用例的文本,在编辑模板时,您可以在占位符选项卡中查看和编辑它们。


I'm integrating Passlot in my app for wallet integration. I'd created new pass type id and added it in Passslot.

I'd created a pass template for type - boarding pass as below,

And in my app, i'm creating the pass with the above template and a dictionary with values,

NSDictionary *values = [NSDictionary dictionaryWithObjectsAndKeys:
                        @"14", @"gate" ,
                        @"India", @"depart" ,
                        @"UAE", @"arrive" ,
                        @"2:25 PM", @"boardingTime",
                        @"Air India", @"flightNewName" ,
                        @"first", @"class",
                        @"7/22", @"date" ,
                        @"name", @"passenger",nil];

[PassSlot createPassFromTemplateWithName:@"Sample" withValues:values andRequestInstallation:self completion:^{
    NSLog(@"Created");
}];

The pass is created, but the values that I'm passing are not there in the pass. It's showing the default values in the pass template.

I'm passing the values in the dictionary input. why it's not coming?

How can I solve it? Please guide me on this.

解决方案

In order for PassSlot to be able to show your provided data, you need to tell the system where it should appear on the pass.

For this we have our so called placeholder system. It allows you to define any number of data fields, called placeholders, that can be provided during creation of the pass.

The easiest way to create placeholders on the fly and tell the system where to show the data is by writing ${<name of placeholder>} on your template. This will automatically create a text placeholder for you.

So in order for your provided gate 14 from to data to appear on the top right of the pass, replace on the template the 23 with ${gate}. The same you can do with all other provided data as well.

Placeholders are pretty flexible, you can use them anywhere (barcode, backside & non-visible parts) and you can also have multiple placeholders per field (e.g. you could have PASSENGER composed of ${firstName} ${lastName}). Placeholders can also have different types then text for advanced use cases, you can see and edit them in the placeholders tab when you edit the template.

这篇关于如何使用Passslot向pass中添加值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆