SUMMARY: 
Push notifications *always* work perfectly if my app is installed via XCode, but if installed via iTunes then they if they work or not depends upon the profiles used to sign the distrubtion. 
BUT some profile combinations which used to work no longer do, and some which didn't now do. 

My primary question is which combination of profiles should be used to sign an ad-hoc distrubtion that uses push notifications, and secondary question is why have I observed inconsistency in behavior over time.

DETAILS:
I am developing an app that uses APNs and have been having problems getting the notifications to arrive when the application is distributed as an ad-hoc app and installed via iTunes. The problems are obviously related to it not being signed with the correct profiles but some observations over the past few weeks have left me confused as to what profiles I am supposed to be using to sign the distrubtion.

I had been under the impression that the ad-hoc profile should be used at both phases where signing is required - firstly setting it as the code-signing identiy within XCode as the Archive is being built, and then secondly to sign the distribution. I've been doing it this way and its been working - devices have been able to recieve the push notifications.

Then a few weeks ago the devices stopped receiving push notifications, though there were able to receive them if the build was signed with my development profile and installed via XCode, it was only the ad-hoc distributions that stopped receiving them. After a couple of days of trying everything I eventually deleted the push and ad-hoc profiles and created new ones and everything was working again ... until a couple of days ago when the same thing happened.

I created a new ad-hoc profile again but I still couldn't get the ad-hoc distrubtions to receive the push notifications (though the devices would once again still receive them if the app was installed via XCode). Eventually I changed from signing the distribution with the ad-hoc profile to using the apple push profile and things started working again.
So now I am confused:

```
- am I supposed to sign ad-hoc distrubtions using a) the ad-hoc profile for the archive and then ad-hoc profile again when signing the distribtion of the archive or b) the ad-hoc profile for the archive and the push profile when signing the distribution of the archive?

```

For XCode installations I set the code signing identity to my development profile. For ad-hoc distrubtions I set the code signing identity for the archive to the ad-hoc profile, then at the distrubtion part of the archive sign it again with the ad-hoc OR the push. The OR is there because sometimes one combination works sometimes the other combination works, my whole question therefore is which combination SHOULD it be and why have I observed inconsistency in which combination works and which doesn't.

Thanks

EDIT:
This is a list of the profiles there are, i.e. if I logon to the Apple provisioning portal then click on the provisioning tab then the development tab it lists these:

1) Apple Push Profile - needed to enable APNs

2) NNN Development profile (where NNN is the name of the project)

3) iOS Development profile 

4) iOS Team Provisioning Profile

If I click on the provisioning tab then on the distribution tab it lists these:

1) Ad-hoc

In all my extensive searches of books, documentation, forums over a period of many months I have yet to find *definitive* explanation of which combinations of the above should be used under what circumstances *and which take push notifications into consideration*.
A problem is that most documentation and examples do not take push notifications into consideration and this is crucial omission because without the right combination of profiles in the right order the app can install onto the device but push notifications will never be received.