Skip to content

Commit 740f84f

Browse files
committed
Implemented workaround for issue that ParsePush was erroneously considered as unused and stripped out by the VM during iOS compilation. This results in a compiler error when building the iOS native code.
See https://groups.google.com/d/msg/codenameone-discussions/r1svrNwVOA8/6d1QmMVfBQAJ for more information on the problem.
1 parent df5fb96 commit 740f84f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/com/parse4cn1/Parse.java

+15
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,21 @@ static public void initialize(String applicationId, String clientKey) {
194194
ParseRegistry.registerDefaultSubClasses();
195195
ParseRegistry.registerExternalizableClasses();
196196
ParseOperationDecoder.registerDefaultDecoders();
197+
198+
/*
199+
This is a workaround to prevent the over-zealous stripping away
200+
of unused classed by the CN1 VM during iOS builds which results in
201+
a compilation error when ParsePush is not explicitly used in an app
202+
that includes this library. Apparently, the stripper has a bug that
203+
causes usage of ParsePush in iOS native code not to be detected, hence
204+
the class is stripped which subsquently results in a 'file not found'
205+
error while compiling the iOS native code that imports it.
206+
207+
The workaround is to make the following 'harmless' call so that
208+
ParsePush is considered used and thus not stripped out during iOS compilation.
209+
See also:https://groups.google.com/d/msg/codenameone-discussions/r1svrNwVOA8/6d1QmMVfBQAJ
210+
*/
211+
ParsePush.isUnprocessedPushDataAvailable();
197212
}
198213

199214
/**

0 commit comments

Comments
 (0)