Second order cohomology and $U(1)$-principal bundles In Homotopy Moment Map the following is stated

If the symplectic form represents an integral cohomology class,
then it corresponds to the curvature of a principal $U(1)$-bundle equipped with a connection

My question is: Given a closed 2-form $\omega$ representing an integral cohomology class, is there a way to explicitly construct the corresponding $U(1)$-principal bundle?
The only idea I had was the following: Take a form $\omega$ on $X$, taking a good cover $\{U_i\hookrightarrow X\}_i$ $$d(\omega|_{U_i})=(d\omega)|_{U_i}=0\xrightarrow{\text{Poicaré lemma}}\omega|_{U_i}=dA_i$$
for some $1$-form $A_i$, for all $i$. Then, letting $U_{ij}=U_i\cap U_j$ $$d(A_i|_{U_{ij}}-A_j|_{U_{ij}})=(dA_i)|_{U_{ij}}-(dA_j)|_{U_{ij}}=\omega|_{U_{ij}}-\omega|_{U_{ij}}=0\xrightarrow{\text{Poicaré lemma}}A_i|_{U_{ij}}-A_j|_{U_{ij}}=df_{ij}$$ for some $f_{ij}:U_{ij}\rightarrow\mathbb R$. Doing the calculations again we can prove that restricted to $U_{ijk}=U_i\cap U_j\cap U_k$ $$d(f_{ij}+f_{jk}-f_{ik})=0\xrightarrow{\text{Poicaré lemma}} f_{ij}+f_{jk}-f_{ik}=c_{ijk}$$for some constant $c_{ijk}\in\mathbb R$. My claim (which I don't even know if it's true) is that $c_{ijk}$ can be chosen to be an integer and $$g_{ij}:U_{ij}\xrightarrow{f_{ij}}\mathbb R\xrightarrow{\text{exp}} U(1)$$ are the transition maps giving the a $U(1)$-bundle.
 A: Here's an attempt using sheaf cohomology. It'd be nice for someone to review this though, as I am just learning the subject.
Take the short exact sequence of sheaves
$$
0 \rightarrow \mathbb{Z}\overset{i}{\rightarrow} C_\mathbb{R}^\infty
\overset{\exp(2\pi i~\cdot)}{\rightarrow} (C_\mathbb{C}^\infty)^*\rightarrow 0
$$
where $(C_\mathbb{C}^\infty)^*$ is the sheaf over your manifold of valued local nowhere vanishing functions. Taking long exact sequence in cohomology and realizing that the existence of partitions of unity implies that $H^1(M,C^\infty)=0$ then you have that
$$H^2(M,\mathbb{Z}) \simeq H^1(M,(C^\infty)^*).$$
Your integral 2-form $\omega$ can be seen to lie on the LHS while elements of the RHS can be seen as Cech 1-cocycles giving the transition functions $g_{\alpha\beta}:U_\alpha\cap U_\beta\rightarrow \mathbb{C}^*$, and then these determine your bundle once you normalize them (equivalent to reducing the structure group from $\mathbb{C}^*$ to U(1)).
More explicit? Explicitly construct a nice covering of your manifold, which should be possible for easy examples, and explicitly write out the corresponding isomorphisms. It could be a nice exercise to do this over the 2-sphere, where you have a nice covering with only two open sets, and you already know that U(1)-bundles over $S^2$ are indexed by an integer in $\mathbb{Z}\simeq H^2(S^2,\mathbb{Z})$.
A: The class $[\omega]\in H^2(X;\mathbb{Z})$ corresponds to an isomorphism class of principal $U(1)$ bundle.
Let $P\to X$ be a representative, this may be easily constructed because $H^2(X;\mathbb{Z})\simeq[X,\mathbb{CP}^\infty]$ therefore $[\omega]$ gives a  map $f_\omega: X\to \mathbb{CP}^\infty$ (up to homotopy) and we can use the latter to pull back the $U(1)$-universal bundle to $X$.
Now that we have $P$,  consider any connection $\nabla$ over it, its curvature will give  an element $[\frac{i}{2\pi}F_\nabla]= [\omega]\in \Omega^2(X,\mathbb{R})$ by Chern-Weyl theory.
So they differ by an exact form, say $\frac{i}{2\pi}F_\nabla = \omega + da$ for some  $a \in \Omega^1(X)$.
Then the conclusion follows by considering the connection $\nabla + (i/2\pi)^{-1}a$ (recall that $F_{\nabla + b} = F_\nabla + db)$.
