The team at Particle has announced that the Photon 2 offers limited support for retained memory. This might refer to the specific amount of space allocated for retaining data, maybe?
The previous Photon model required a battery to maintain data in retained memory.
In contrast, the Photon 2 does not need a battery for this purpose. It can keep the retained data intact, even if you power it off completely.
As usually, just add the STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));
to your code. This enables the retained memory feature.
After enabling the feature, declare the variables you want to retain. It's as simple as that!
Another interesting detail is the analog readings. Basically the Photon 2 is right on the spot! All good from 0V all the way to 3.3V!