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 <[email protected]> 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" <[email protected]> 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 for more
>> info.
>>
>> On Thu, May 17, 2012 at 11:35 AM, Eyal Berman <[email protected]>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 <[email protected]>wrote:
>>>>
>>>>> in my onCreate of the main avtivity i put that code
>>>>>
>>>>> Intent registrationIntent = new Intent("com.google.android.**
>>>>> c2dm.intent.REGISTER");
>>>>> registrationIntent.putExtra("**app", PendingIntent.getBroadcast(**this,
>>>>> 0, new Intent(), 0)); // boilerplate
>>>>> registrationIntent.putExtra("**sender", "[email protected]");
>>>>> startService(**registrationIntent);
>>>>>
>>>>> 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.**android.c2dm.intent.RECEIVE"
>>>>> />
>>>>>                 <category android:name="com.xxxxxx.**testc2dm" />
>>>>>             </intent-filter>
>>>>>             <intent-filter>
>>>>>                 <action android:name="com.google.**
>>>>> android.c2dm.intent.**REGISTRATION" />
>>>>>                 <category android:name="com.xxxxxx.**testc2dm" />
>>>>>             </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@**
>>>>> googlegroups.com <[email protected]>
>>>>> To unsubscribe from this group, send email to
>>>>> android-developers+**[email protected]<android-developers%[email protected]>
>>>>> 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 [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>> 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 [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to