Great thanks
Using Sync Gateway 1.0.3
I will try to go for the option described by Jens in the third comment of 
https://github.com/couchbase/sync_gateway/issues/379 
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fcouchbase%2Fsync_gateway%2Fissues%2F379&sa=D&sntz=1&usg=AFQjCNF8tnGAO5-etCCnRBwAhFvtsyt_ww>
Another option would be to query the view directly to the Couchbase Server 
with https://github.com/couchbase/couchnode ?

I'm still not sure in which use case to use the sync-wrangler approach with 
channels instead of view queries 
https://github.com/couchbaselabs/CouchChat-iOS/blob/push/push-notifications/index.js

On Thursday, 13 November 2014 22:02:23 UTC, Traun Leyden wrote:
>
> You can access views via the admin API now, see:
>
> https://github.com/couchbase/sync_gateway/issues/379
>
> The non-admin API is coming soon:
>
> https://github.com/couchbase/sync_gateway/issues/449
>
> Which version of Sync Gateway are you running?
>
>
> On Thu, Nov 13, 2014 at 1:57 PM, James Nocentini <[email protected] 
> <javascript:>> wrote:
>
>> I'm trying to set up Apple Push Notifications when some user actions are 
>> triggered on the app. Here's what I have managed to do so far:
>> - User logs in and accepts to receive push notifications
>> - New Profile document is saved with device_token as one property
>> - Then when a push notification is needed, create a Notification document 
>> and save it.
>>
>> Using follow <https://github.com/iriscouch/follow> to get notified of 
>> changes and check if the type of the document is "notification". From there 
>> I need the list of device tokens but I'm struggling to get them.
>> Tried using cradle <https://github.com/flatiron/cradle> but I can't get 
>> save/query views to work. It seems like the sync gateway REST interface 
>> doesn't support views?
>>
>> follow(configuration, function(error, change) {
>>   if (!error) {
>>     console.log('got change number ' + change.seq + ': ' + change.id);
>>
>>     if (change.doc.type == "notification") {
>>       
>>       // missing: query a view on the sync gateway
>>       // to retrieve all the device tokens
>>       // to send the notification to
>>       
>>     }
>>   }
>> });
>>
>> Looking at the push notification robot 
>> <https://github.com/couchbaselabs/CouchChat-iOS/blob/push/push-notifications/index.js>
>>  to 
>> fetch those device tokens via a channel but I couldn't find the 
>> sync-wrangler node module.
>> What's the best way to retrieve device tokens in this case?
>>
>> Thanks
>>
>> On Monday, 9 June 2014 16:48:20 UTC+1, Jens Alfke wrote:
>>>
>>>
>>> On Jun 9, 2014, at 8:26 AM, CouchbaseLover <[email protected]> wrote:
>>>
>>> Ok let's say we expand the way "CouchChat" works and implement Apple's 
>>> Notifications but without the use of talking to the APNS server. Instead we 
>>> check the gateway’s _changes feed and use that instead to make a 
>>> "UILocalNotfication" instead of a "Push Notification" that needs to talk to 
>>> the APNS server.
>>>
>>>
>>> Oh, I see. This will only work while your app is active/visible. The 
>>> main advantage of push notifications is that they can be delivered even 
>>> when your app isn’t running. Push notifications also don’t require keeping 
>>> an open socket to the server, so they’re a lot better for battery life. 
>>> (They’re triggered from a sideband message over regular GSM, kind of like 
>>> an invisible SMS message, so they don’t require keeping the faster and more 
>>> power-hungry 3G/LTE/4G/WiFi radios active.)
>>>
>>> —Jens
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Couchbase Mobile" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/mobile-couchbase/3f089edf-73a9-4efc-ab33-67f224e45c6d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/mobile-couchbase/3f089edf-73a9-4efc-ab33-67f224e45c6d%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/9433b1c8-3077-4350-b49c-31f50435f9ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to