小编Edi*_*dig的帖子

在php中为passbook创建pass

我试图为我的应用程序动态创建优惠券.我有一个PHP服务器来创建它们.但我不知道他们为什么不在存折上工作.

如果我从终端创建传球它工作正常.但在PHP中使用PHP-PKPass.

我在PHP下面留下了代码,它在我的计算机中出现了通行证,但它没有添加到存折中(如果我通过电子邮件发送)

我100%确定passTypeIdentifier,teamIdentifier,Certificate和WWDR 100%正确

注意:所有图像都存在

<?php
include ("conexion.php");
require('passpk/PKPass.php');

if (isset($_GET['cupon']) and $_GET['cupon'] != '' and $_GET['cupon'] > 0) {

    $cuponID = $_GET['cupon'];


    $pass = new PKPass\PKPass();

    $pass->setCertificate('./Certificate.p12');  // 2. Set the path to your Pass Certificate (.p12 file)
    $pass->setCertificatePassword('*******');     // 2. Set password for certificate
    $pass->setWWDRcertPath('./WWDR.pem'); // 3. Set the path to your WWDR Intermediate certificate (.pem file)


    // Top-Level Keys http://developer.apple.com/library/ios/#documentation/userexperience/Reference/PassKit_Bundle/Chapters/TopLevel.html
    $standardKeys         = array(
        'description'        => 'Store',
        'formatVersion'      => 1,
        'organizationName'   => 'Store',
        'passTypeIdentifier' => 'pass.store.store', // …
Run Code Online (Sandbox Code Playgroud)

php passbook

5
推荐指数
1
解决办法
4247
查看次数

使用CCTouchDispatcher Cocos2d 2.0 Beta-2 ARC

我用cocos2d 2.0 BETA 2.0创建了一款游戏[最新版本].我需要在其他课程中添加一个操纵杆.所以我在第二节课中称之为"CCTouchDispatcher".但我不能这样打电话:

[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
Run Code Online (Sandbox Code Playgroud)

所以我做了这个:

_tocuhDispatcher = [[CCTouchDispatcher alloc] init];
[_tocuhDispatcher addTargetedDelegate:self priority:0 swallowsTouches:YES];
Run Code Online (Sandbox Code Playgroud)

但仍然无法检测到触动.如果我启用HelloWorldLayer中的触摸,我可以移动我的对象,但操纵杆不起作用

我能做什么?

iphone objective-c cocos2d-iphone joystick

4
推荐指数
1
解决办法
2889
查看次数

SetAsEdge问题Cocos 2D

我正在尝试用Cocos 2D和Box 2D制作游戏

但是当我试图放一个"setAsEdge"时,它只是说我的功能不存在

我的代码:

// Define the ground body.
    b2BodyDef groundBodyDef;
    groundBodyDef.position.Set(0, 0); // bottom-left corner

    // Call the body factory which allocates memory for the ground body
    // from a pool and creates the ground box shape (also from a pool).
    // The body is also added to the world.
    groundBody = world->CreateBody(&groundBodyDef);

    // Define the ground box shape.
    b2PolygonShape groundBox;       

    // bottom
    groundBox.SetAsEdge(b2Vec2(0,FLOOR_HEIGTH/PTM_RATIO), b2Vec2(screenSize.width*2.0f/PTM_RATIO,FLOOR_HEIGTH/PTM_RATIO));
    groundBody->CreateFixture(&groundBox,0);

    // top
    groundBox.SetAsEdge(b2Vec2(0,screenSize.height/PTM_RATIO), b2Vec2(screenSize.width*2.0f/PTM_RATIO,screenSize.height/PTM_RATIO));
    groundBody->CreateFixture(&groundBox,0);

    // left
    groundBox.SetAsEdge(b2Vec2(0,screenSize.height/PTM_RATIO), b2Vec2(0,0));
    groundBody->CreateFixture(&groundBox,0);

    // right …
Run Code Online (Sandbox Code Playgroud)

iphone cocos2d-iphone

1
推荐指数
1
解决办法
4869
查看次数

标签 统计

cocos2d-iphone ×2

iphone ×2

joystick ×1

objective-c ×1

passbook ×1

php ×1