since particle has not (and will not) release a native ios library to configure (wifi) in the p2 and our ios developers have no experience with ec-jpake and aes encryption needed to implement this, we are forced to find another solution
and for other users: it could very well be the p2 datamatrix is not visible from the outside of your product:
we flash the p2’s in the factory and read the device id. we also create a random qr-code for the product and associate the two on our server. when a phone is attempting to setup the p2, we ask the particle cloud for the mobile secret using the device id.