NIFCLOUD-mbaas / UserCommunity

ニフクラ mobile backend ユーザーコミュニティ
https://mbaas.nifcloud.com/
81 stars 18 forks source link

配列の一つに合致していたらプッシュ配信をしたいです #171

Closed irandy closed 9 years ago

irandy commented 9 years ago

配列の一つに合致していたらプッシュ配信をしたいのですが、うまく動きません。 下記は実装してみたコードですけど、store_idsは[値1、値2、値3]のどれかに合致していたらプッシュ通知を送信するという動きを作りたいですが、どうすればいいでしょうか?

function test($message){
        $content = [
            'immediateDeliveryFlag' => true,
            'target' => ['ios','android'],
            'badgeIncrementFlag' => true,
            'message' => $message,
            'searchCondition' => [
                    'store_ids' => [
                        "test2", "test3", "test4", "test5", "test6"
                    ]
            ]
        ];

        $api = new \Nifty\Cloud\mBaaS\API($this->api_params);
        $result = $api->request('push', $content);
    }
goofmint commented 9 years ago

@irandy

http://mb.cloud.nifty.com/doc/rest/common/query.html

検索条件はオペランドで指定可能です。今回の目的で言うと、$inになるかと思います。

irandy commented 9 years ago

非常に助かりました!ありがとうございます!!!