The app is the responsible party for getting a registration id. You could
at any point notify your app as part of an API response that the server
doesn't have a registrationId, but if you're supporting Android OS versions
< 2.2, those phones won't even be capable of getting a registrationId.

On Thu, May 17, 2012 at 12:13 PM, Eyal Berman <bermane...@gmail.com> wrote:

> my architecture is like this:
> the app onCreate send check the local storage for registrationId - if the
> registrationId is empty it register and send the registrationId and
> devaiceid to a webService that store it on DB
>
> then a service is look in db for new messages and if there are he push
> them to app. if it dosent succssess how i tell the app to send another
> registrationId?
>
>
>
> On Thursday, May 17, 2012 6:52:49 PM UTC+3, Dallas Gutauckis wrote:
>>
>> I recommend that you save it in the application's storage and only
>> attempt to register again for an id when the registration id is no longer
>> valid. The documentation I linked to explains that you may get an
>> unregistration "REGISTRATION' intent which would be the registration
>> broadcast without an id. The registration id should be stored on the
>> server-side of your architecture so the notification can be pushed using
>> that registration id.
>>
>> On Thu, May 17, 2012 at 11:45 AM, Berman Eyal <bermane...@gmail.com>wrote:
>>
>>> So I need to save registrationid on app db and every some time to check
>>> it against Google?
>>> On 17 במאי 2012 18:42, "Dallas Gutauckis" <dall...@gmail.com> wrote:
>>>
>>>> The registration id changes every time you request it. Additionally, it
>>>> may change periodically without request. Make sure the server always
>>>> receives the latest registration id broadcasted.
>>>>
>>>> See 
>>>> https://developers.google.**com/android/c2dm/#registering<https://developers.google.com/android/c2dm/#registering>for
>>>>  more info.
>>>>
>>>> On Thu, May 17, 2012 at 11:35 AM, Eyal Berman <bermane...@gmail.com>wrote:
>>>>
>>>>> did the registrationId is changing or it is always the same until the
>>>>> next instalation?
>>>>>
>>>>>
>>>>> On Thursday, May 17, 2012 4:55:07 PM UTC+3, Dallas Gutauckis wrote:
>>>>>>
>>>>>> Given that it's in your onCreate of the main activity, I'd say it's
>>>>>> sent every time onCreate is called on your main activity, unless you've
>>>>>> added additional logic you're not showing.
>>>>>>
>>>>>> On Thu, May 17, 2012 at 3:02 AM, Eyal Berman <bermane...@gmail.com>wrote:
>>>>>>
>>>>>>> in my onCreate of the main avtivity i put that code
>>>>>>>
>>>>>>> Intent registrationIntent = new Intent("com.google.android.**c2d**
>>>>>>> m.intent.REGISTER");
>>>>>>> registrationIntent.putExtra("**a**pp", PendingIntent.getBroadcast(**
>>>>>>> thi**s, 0, new Intent(), 0)); // boilerplate
>>>>>>> registrationIntent.putExtra("**s**ender", "bermane...@gmail.com");
>>>>>>> startService(**registrationInten**t);
>>>>>>>
>>>>>>> i add the reciver to manifest.xml
>>>>>>>
>>>>>>> <receiver
>>>>>>>             android:name=".MyC2dmReceiver"
>>>>>>>             
>>>>>>> android:permission="com.**google**.android.c2dm.**permission.SEND"
>>>>>>> >
>>>>>>>             <intent-filter>
>>>>>>>                 <action 
>>>>>>> android:name="com.google.**andro**id.c2dm.intent.RECEIVE"
>>>>>>> />
>>>>>>>                 <category android:name="com.xxxxxx.**testc**2dm" />
>>>>>>>             </intent-filter>
>>>>>>>             <intent-filter>
>>>>>>>                 <action android:name="com.google.**andro**
>>>>>>> id.c2dm.intent.**REGISTRATION" />
>>>>>>>                 <category android:name="com.xxxxxx.**testc**2dm" />
>>>>>>>             </intent-filter>
>>>>>>>         </receiver>
>>>>>>>
>>>>>>> i try to send the registrationID to my server
>>>>>>> when it's send? just in the first time (installation ) or every time
>>>>>>> the app is loadded?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Android Developers" group.
>>>>>>> To post to this group, send email to android-developers@**
>>>>>>> googlegroup**s.com <android-developers@googlegroups.com>
>>>>>>> To unsubscribe from this group, send email to
>>>>>>> android-developers+**unsubscribe**@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
>>>>>>> For more options, visit this group at
>>>>>>> http://groups.google.com/**group**/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>
>>>>>>
>>>>>>
>>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Android Developers" group.
>>>>> To post to this group, send email to android-developers@**
>>>>> googlegroups.com <android-developers@googlegroups.com>
>>>>> To unsubscribe from this group, send email to
>>>>> android-developers+**unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>
>>>>>
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Android Developers" group.
>>>> To post to this group, send email to android-developers@**
>>>> googlegroups.com <android-developers@googlegroups.com>
>>>> To unsubscribe from this group, send email to
>>>> android-developers+**unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
>>>> For more options, visit this group at
>>>> http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Developers" group.
>>> To post to this group, send email to android-developers@**
>>> googlegroups.com <android-developers@googlegroups.com>
>>> To unsubscribe from this group, send email to
>>> android-developers+**unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
>>> For more options, visit this group at
>>> http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>
>>>
>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to