Since your code needs to be built for the device, you can use conditional compile directives
#if (PLATFORM_ID == 6)
// Photon
#elif (PLATFORM_ID == 0)
// Core with yet to be released FW v0.4.x
#else
// Core with FW v0.3.4
#endif
See
Preprocessor #ifdef to Detect Platform Type (Core/Photon) at Compile Time