rhodes 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +10 -0
- data/lib/framework/rhodes.rb +2 -2
- data/lib/framework/version.rb +2 -2
- data/lib/rhodes.rb +2 -2
- data/platform/android/Rhodes/AndroidManifest.xml +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +7 -13
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +4 -4
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +19 -20
- data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +88 -26
- data/platform/iphone/Classes/MapView/MapViewController.m +33 -32
- data/platform/iphone/Classes/WebViewController.m +4 -2
- data/platform/iphone/Info.plist +1 -1
- data/platform/shared/common/RhodesApp.cpp +77 -61
- data/platform/shared/common/RhodesApp.h +1 -0
- data/platform/shared/ruby/ext/mapview/mapview.i +18 -48
- data/platform/shared/ruby/ext/mapview/mapview_wrap.c +20 -50
- data/platform/shared/ruby/ext/system/system_properties.c +2 -0
- data/res/generators/templates/application/Rakefile +1 -0
- metadata +1 -3
- data/Manifest.txt +0 -7529
- data/rhobuild.yml +0 -36
data/CHANGELOG
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
== 1.4.2
|
2
|
+
* Fix for BB push data
|
3
|
+
* Fix issue #2547236 - BB map: incorrect drawing of world bounds (90N/90S, 180W/180E)
|
4
|
+
* Fix issue #2539966 - System::get_property('platform') on Android is UNKNOWN
|
5
|
+
* Fix issue #2540390 - blackberry map causes exception
|
6
|
+
* Fix issue #2547920 - update attributes on new object doesn't call updateobjects
|
7
|
+
* Fix issue #2561942 - BB Map: crash in case of wrong input parameters
|
8
|
+
* Fix issue #2561958 - iPhone map: crash in case of wrong input parameters
|
9
|
+
* Fix issue #2581678 - Android: GPS updates does not work
|
10
|
+
|
1
11
|
== 1.4.1
|
2
12
|
* fixed issue with empty cookie check failing
|
3
13
|
|
data/lib/framework/rhodes.rb
CHANGED
data/lib/framework/version.rb
CHANGED
data/lib/rhodes.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
2
2
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
3
3
|
package="com.rhomobile.rhodes"
|
4
|
-
android:versionCode="
|
5
|
-
android:versionName="1.4.
|
4
|
+
android:versionCode="21"
|
5
|
+
android:versionName="1.4.2">
|
6
6
|
<uses-sdk android:minSdkVersion="3"></uses-sdk>
|
7
7
|
<application android:icon="@drawable/icon" android:multiprocess="true" android:allowTaskReparenting="true" android:debuggable="true"
|
8
8
|
finishOnTaskLaunch="true" android:label="@string/app_name">
|
@@ -13,15 +13,13 @@ import android.os.Looper;
|
|
13
13
|
public class GeoLocationImpl implements LocationListener {
|
14
14
|
|
15
15
|
private static final String TAG = "GeoLocationImpl";
|
16
|
+
private static final String PROVIDER = LocationManager.GPS_PROVIDER;
|
16
17
|
private LocationManager locationManager;
|
17
18
|
private double longitude = 0;
|
18
19
|
private double latitude = 0;
|
19
20
|
private boolean determined = false;
|
20
|
-
|
21
|
+
|
21
22
|
public GeoLocationImpl() {
|
22
|
-
|
23
|
-
Looper.prepare();
|
24
|
-
|
25
23
|
setCurrentGpsLocation(null);
|
26
24
|
}
|
27
25
|
|
@@ -29,13 +27,10 @@ public class GeoLocationImpl implements LocationListener {
|
|
29
27
|
Logger.T(TAG, "GeoLocationImpl.setCurrentGpsLocation");
|
30
28
|
try {
|
31
29
|
if (location == null) {
|
32
|
-
locationManager = (LocationManager) RhodesInstance
|
33
|
-
|
34
|
-
|
35
|
-
locationManager.
|
36
|
-
LocationManager.GPS_PROVIDER, 0, 0, this);
|
37
|
-
location = locationManager
|
38
|
-
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
|
30
|
+
locationManager = (LocationManager) RhodesInstance.getInstance()
|
31
|
+
.getSystemService(Context.LOCATION_SERVICE);
|
32
|
+
locationManager.requestLocationUpdates(PROVIDER, 0, 0, this, Looper.getMainLooper());
|
33
|
+
location = locationManager.getLastKnownLocation(PROVIDER);
|
39
34
|
}
|
40
35
|
if (location != null) {
|
41
36
|
longitude = location.getLongitude();
|
@@ -45,8 +40,7 @@ public class GeoLocationImpl implements LocationListener {
|
|
45
40
|
determined = false;
|
46
41
|
}
|
47
42
|
|
48
|
-
Logger.T(TAG, "gps enabled: " + new Boolean(locationManager.isProviderEnabled(
|
49
|
-
LocationManager.GPS_PROVIDER)).toString());
|
43
|
+
Logger.T(TAG, "gps enabled: " + new Boolean(locationManager.isProviderEnabled(PROVIDER)).toString());
|
50
44
|
Logger.T(TAG, "determined: " + new Boolean(determined).toString());
|
51
45
|
if (determined) {
|
52
46
|
Logger.T(TAG, "longitude: " + new Double(longitude).toString());
|
@@ -93,7 +93,7 @@ public class PushListeningThread extends Thread {
|
|
93
93
|
}
|
94
94
|
|
95
95
|
try{
|
96
|
-
processPushMessage(data);
|
96
|
+
processPushMessage(data, db.getLength());
|
97
97
|
}catch(Exception exc)
|
98
98
|
{
|
99
99
|
LOG.ERROR("processPushMessage failed.Data: " + new String(data), exc);
|
@@ -219,14 +219,14 @@ public class PushListeningThread extends Thread {
|
|
219
219
|
RhodesApplication.getInstance().play_file(file_name, media_type);
|
220
220
|
}
|
221
221
|
|
222
|
-
private void processPushMessage(final byte[] data)
|
222
|
+
private void processPushMessage(final byte[] data, int nLen)
|
223
223
|
{
|
224
224
|
/* Application.getApplication().invokeLater(new Runnable()
|
225
225
|
{
|
226
226
|
public void run()
|
227
227
|
{*/
|
228
|
-
String msg = new String(data);
|
229
|
-
LOG.INFO("Triger sync on PUSH message [" + msg + " ]
|
228
|
+
String msg = new String(data, 0, nLen);
|
229
|
+
LOG.INFO("Triger sync on PUSH message [" + msg + " ]");
|
230
230
|
|
231
231
|
String[] op;
|
232
232
|
String[] ops = split(msg,"\n");
|
@@ -60,7 +60,8 @@ public class GoogleMapField extends Field implements RhoMapField {
|
|
60
60
|
|
61
61
|
// Mode of decoding EncodedImage to bitmap
|
62
62
|
private static final int DECODE_MODE = EncodedImage.DECODE_NATIVE |
|
63
|
-
EncodedImage.DECODE_NO_DITHER | EncodedImage.DECODE_READONLY
|
63
|
+
EncodedImage.DECODE_NO_DITHER | EncodedImage.DECODE_READONLY |
|
64
|
+
EncodedImage.DECODE_ALPHA;
|
64
65
|
|
65
66
|
// Static google parameters
|
66
67
|
private static final int MIN_ZOOM = 0;
|
@@ -69,6 +70,7 @@ public class GoogleMapField extends Field implements RhoMapField {
|
|
69
70
|
private static final int MAX_GOOGLE_TILE_SIZE = 640;
|
70
71
|
|
71
72
|
// Constants required to coordinates calculations
|
73
|
+
private static final long MIN_LATITUDE = degreesToPixelsY(90, MAX_ZOOM);
|
72
74
|
private static final long MAX_LATITUDE = degreesToPixelsY(-90, MAX_ZOOM);
|
73
75
|
private static final long MAX_LONGITUDE = degreesToPixelsX(180, MAX_ZOOM);
|
74
76
|
|
@@ -81,8 +83,8 @@ public class GoogleMapField extends Field implements RhoMapField {
|
|
81
83
|
|
82
84
|
//===============================================================================
|
83
85
|
// Coordinates of center in pixels of maximum zoom level
|
84
|
-
private long latitude = 0;
|
85
|
-
private long longitude = 0;
|
86
|
+
private long latitude = degreesToPixelsY(0, MAX_ZOOM);
|
87
|
+
private long longitude = degreesToPixelsX(0, MAX_ZOOM);
|
86
88
|
private int zoom = 0;
|
87
89
|
|
88
90
|
private int tileSize;
|
@@ -343,7 +345,8 @@ public class GoogleMapField extends Field implements RhoMapField {
|
|
343
345
|
url.append("&zoom=" + cmd.zoom);
|
344
346
|
url.append("&size=" + cmd.width + "x" + cmd.height);
|
345
347
|
url.append("&maptype=" + cmd.maptype);
|
346
|
-
url.append("&format=png&
|
348
|
+
url.append("&format=png&sensor=false");
|
349
|
+
url.append("&mobile=" + (cmd.maptype.equals("roadmap") ? "true" : "false"));
|
347
350
|
url.append("&key=" + mapkey);
|
348
351
|
if (!cmd.annotations.isEmpty()) {
|
349
352
|
url.append("&markers=color:blue");
|
@@ -682,6 +685,8 @@ public class GoogleMapField extends Field implements RhoMapField {
|
|
682
685
|
}
|
683
686
|
|
684
687
|
private String makeCacheKey(long lat, long lon, int z) {
|
688
|
+
while (lon < 0) lon += MAX_LONGITUDE;
|
689
|
+
while (lon > MAX_LONGITUDE) lon -= MAX_LONGITUDE;
|
685
690
|
long x = lon/tileSize;
|
686
691
|
long y = lat/tileSize;
|
687
692
|
StringBuffer buf = new StringBuffer();
|
@@ -835,15 +840,8 @@ public class GoogleMapField extends Field implements RhoMapField {
|
|
835
840
|
}
|
836
841
|
|
837
842
|
private void validateCoordinates() {
|
838
|
-
if (latitude <
|
843
|
+
if (latitude < MIN_LATITUDE) latitude = MIN_LATITUDE;
|
839
844
|
if (latitude > MAX_LATITUDE) latitude = MAX_LATITUDE;
|
840
|
-
if (longitude < 0) longitude = 0;
|
841
|
-
if (longitude > MAX_LONGITUDE) longitude = MAX_LONGITUDE;
|
842
|
-
}
|
843
|
-
|
844
|
-
private void validateZoom() {
|
845
|
-
if (zoom < MIN_ZOOM) zoom = MIN_ZOOM;
|
846
|
-
if (zoom > MAX_ZOOM) zoom = MAX_ZOOM;
|
847
845
|
}
|
848
846
|
|
849
847
|
public void moveTo(double lat, double lon) {
|
@@ -876,8 +874,9 @@ public class GoogleMapField extends Field implements RhoMapField {
|
|
876
874
|
|
877
875
|
public void setZoom(int z) {
|
878
876
|
zoom = z;
|
879
|
-
|
880
|
-
|
877
|
+
if (zoom < MIN_ZOOM) zoom = MIN_ZOOM;
|
878
|
+
if (zoom > MAX_ZOOM) zoom = MAX_ZOOM;
|
879
|
+
lastFetchCommandSent = System.currentTimeMillis() + CACHE_UPDATE_INTERVAL;
|
881
880
|
}
|
882
881
|
|
883
882
|
public int calculateZoom(double latDelta, double lonDelta) {
|
@@ -892,6 +891,8 @@ public class GoogleMapField extends Field implements RhoMapField {
|
|
892
891
|
}
|
893
892
|
|
894
893
|
public void addAnnotation(Annotation ann) {
|
894
|
+
if (ann.street_address == null && ann.coordinates == null)
|
895
|
+
return;
|
895
896
|
if (ann.coordinates != null) {
|
896
897
|
long nlat = degreesToPixelsY(ann.coordinates.latitude, MAX_ZOOM);
|
897
898
|
long nlon = degreesToPixelsX(ann.coordinates.longitude, MAX_ZOOM);
|
@@ -936,8 +937,8 @@ public class GoogleMapField extends Field implements RhoMapField {
|
|
936
937
|
}
|
937
938
|
|
938
939
|
private static long degreesToPixelsX(double n, int z) {
|
939
|
-
|
940
|
-
|
940
|
+
while (n < -180.0) n += 360.0;
|
941
|
+
while (n > 180.0) n -= 360.0;
|
941
942
|
double angleRatio = 360/math_pow(2, z);
|
942
943
|
double val = (n + 180)*GOOGLE_TILE_SIZE/angleRatio;
|
943
944
|
return (long)val;
|
@@ -957,16 +958,14 @@ public class GoogleMapField extends Field implements RhoMapField {
|
|
957
958
|
}
|
958
959
|
|
959
960
|
private static double pixelsToDegreesX(long n, int z) {
|
960
|
-
|
961
|
-
|
961
|
+
while (n < 0) n += MAX_LONGITUDE;
|
962
|
+
while (n > MAX_LONGITUDE) n -= MAX_LONGITUDE;
|
962
963
|
double angleRatio = 360/math_pow(2, z);
|
963
964
|
double val = n*angleRatio/GOOGLE_TILE_SIZE - 180.0;
|
964
965
|
return val;
|
965
966
|
}
|
966
967
|
|
967
968
|
private static double pixelsToDegreesY(long n, int z) {
|
968
|
-
if (n < 0) n = 0;
|
969
|
-
if (n > MAX_LATITUDE) n = MAX_LATITUDE;
|
970
969
|
// Revert calculation of Merkator projection
|
971
970
|
double ath = PI - 2*PI*n/(GOOGLE_TILE_SIZE*math_pow(2, z));
|
972
971
|
double th = math_tanh(ath);
|
@@ -16,6 +16,7 @@ import com.xruby.runtime.lang.RubyConstant;
|
|
16
16
|
import com.xruby.runtime.lang.RubyException;
|
17
17
|
import com.xruby.runtime.lang.RubyOneArgMethod;
|
18
18
|
import com.xruby.runtime.lang.RubyRuntime;
|
19
|
+
import com.xruby.runtime.lang.RubySymbol;
|
19
20
|
import com.xruby.runtime.lang.RubyTwoArgMethod;
|
20
21
|
import com.xruby.runtime.lang.RubyValue;
|
21
22
|
import com.xruby.runtime.lang.RubyVarArgMethod;
|
@@ -72,11 +73,23 @@ public class MapView extends RubyBasic {
|
|
72
73
|
RubyArray arKeys = hash.keys();
|
73
74
|
RubyArray arValues = hash.values();
|
74
75
|
for (int i = 0; i != arKeys.size(); ++i) {
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
RubyValue key = arKeys.get(i);
|
77
|
+
RubyValue value = arValues.get(i);
|
78
|
+
if (key == null || value == null)
|
79
|
+
continue;
|
80
|
+
String strKey = key.toString();
|
81
|
+
if (strKey.equals("settings")) {
|
82
|
+
if (!(value instanceof RubyHash))
|
83
|
+
throw new RubyException(RubyRuntime.ArgumentErrorClass,
|
84
|
+
"Wrong 'settings' type, should be Hash");
|
85
|
+
settingsHash = (RubyHash)value;
|
86
|
+
}
|
87
|
+
else if (strKey.equals("annotations")) {
|
88
|
+
if (!(value instanceof RubyArray))
|
89
|
+
throw new RubyException(RubyRuntime.ArgumentErrorClass,
|
90
|
+
"Wrong 'annotations' type, should be Array");
|
91
|
+
annotationsArray = (RubyArray)value;
|
92
|
+
}
|
80
93
|
}
|
81
94
|
}
|
82
95
|
|
@@ -84,24 +97,47 @@ public class MapView extends RubyBasic {
|
|
84
97
|
RubyArray arKeys = settingsHash.keys();
|
85
98
|
RubyArray arValues = settingsHash.values();
|
86
99
|
for (int i = 0; i != arKeys.size(); ++i) {
|
87
|
-
|
100
|
+
RubyValue key = arKeys.get(i);
|
88
101
|
RubyValue value = arValues.get(i);
|
89
|
-
if (
|
90
|
-
|
102
|
+
if (key == null || value == null)
|
103
|
+
continue;
|
104
|
+
String strKey = key.toString();
|
105
|
+
if (strKey.equals("map_type")) {
|
106
|
+
String strValue = value.toString();
|
107
|
+
if (!strValue.equals("roadmap") && !strValue.equals("satellite")
|
108
|
+
&& !strValue.equals("terrain") && !strValue.equals("hybrid"))
|
109
|
+
throw new RubyException(RubyRuntime.ArgumentErrorClass,
|
110
|
+
"Wrong 'map_type' value: " + strValue);
|
111
|
+
settings.put(strKey, strValue);
|
112
|
+
}
|
91
113
|
else if (strKey.equals("zoom_enabled"))
|
92
|
-
settings.put(strKey, new Boolean((
|
114
|
+
settings.put(strKey, new Boolean(value.toString().equalsIgnoreCase("true")));
|
93
115
|
else if (strKey.equals("scroll_enabled"))
|
94
|
-
settings.put(strKey, new Boolean((
|
116
|
+
settings.put(strKey, new Boolean(value.toString().equalsIgnoreCase("true")));
|
95
117
|
else if (strKey.equals("shows_user_location"))
|
96
|
-
settings.put(strKey, new Boolean((
|
118
|
+
settings.put(strKey, new Boolean(value.toString().equalsIgnoreCase("true")));
|
97
119
|
else if (strKey.equals("region")) {
|
120
|
+
if (!(value instanceof RubyArray))
|
121
|
+
throw new RubyException(RubyRuntime.ArgumentErrorClass,
|
122
|
+
"Wrong 'region' type, should be Array");
|
98
123
|
RubyArray arr = (RubyArray)value;
|
99
124
|
if (arr.size() == 4) {
|
100
125
|
Hashtable region = new Hashtable();
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
126
|
+
double[] cs = {0.0, 0.0, 0.0, 0.0};
|
127
|
+
for (int k = 0; k != 4; ++k) {
|
128
|
+
String v = arr.get(k).toString();
|
129
|
+
try {
|
130
|
+
cs[k] = Double.parseDouble(v);
|
131
|
+
}
|
132
|
+
catch (NumberFormatException e) {
|
133
|
+
throw new RubyException(RubyRuntime.ArgumentErrorClass,
|
134
|
+
"Wrong region value: " + v + ", should be Float");
|
135
|
+
}
|
136
|
+
}
|
137
|
+
region.put("latitude", new Double(cs[0]));
|
138
|
+
region.put("longitude", new Double(cs[1]));
|
139
|
+
region.put("latDelta", new Double(cs[2]));
|
140
|
+
region.put("lonDelta", new Double(cs[3]));
|
105
141
|
settings.put(strKey, region);
|
106
142
|
}
|
107
143
|
}
|
@@ -111,34 +147,60 @@ public class MapView extends RubyBasic {
|
|
111
147
|
if (annotationsArray != null) {
|
112
148
|
for (int i = 0; i != annotationsArray.size(); ++i) {
|
113
149
|
Annotation annotation = new Annotation();
|
114
|
-
|
150
|
+
RubyValue val = annotationsArray.get(i);
|
151
|
+
if (!(val instanceof RubyHash))
|
152
|
+
throw new RubyException(RubyRuntime.ArgumentErrorClass,
|
153
|
+
"Wrong annotation value type, should be Hash");
|
154
|
+
RubyHash ann = (RubyHash)val;
|
115
155
|
RubyArray arKeys = ann.keys();
|
116
156
|
RubyArray arValues = ann.values();
|
117
157
|
for (int j = 0, lim = arKeys.size(); j < lim; ++j) {
|
118
|
-
|
158
|
+
RubyValue key = arKeys.get(j);
|
119
159
|
RubyValue value = arValues.get(j);
|
160
|
+
if (key == null || value == null ||
|
161
|
+
key.equals(RubyConstant.QNIL) ||
|
162
|
+
value.equals(RubyConstant.QNIL))
|
163
|
+
continue;
|
164
|
+
String strKey = key.toString();
|
165
|
+
String strValue = value.toString();
|
120
166
|
if (strKey.equals("latitude")) {
|
167
|
+
double v;
|
168
|
+
try {
|
169
|
+
v = Double.parseDouble(strValue);
|
170
|
+
}
|
171
|
+
catch (NumberFormatException e) {
|
172
|
+
throw new RubyException(RubyRuntime.ArgumentErrorClass,
|
173
|
+
"Wrong 'latitude' parameter: " + strValue + ", should be Float");
|
174
|
+
}
|
121
175
|
if (annotation.coordinates == null)
|
122
|
-
annotation.coordinates = new Annotation.Coordinates(
|
176
|
+
annotation.coordinates = new Annotation.Coordinates(v, 0);
|
123
177
|
else
|
124
|
-
annotation.coordinates.latitude =
|
178
|
+
annotation.coordinates.latitude = v;
|
125
179
|
}
|
126
180
|
else if (strKey.equals("longitude")) {
|
181
|
+
double v;
|
182
|
+
try {
|
183
|
+
v = Double.parseDouble(strValue);
|
184
|
+
}
|
185
|
+
catch (NumberFormatException e) {
|
186
|
+
throw new RubyException(RubyRuntime.ArgumentErrorClass,
|
187
|
+
"Wrong 'longitude' parameter: " + strValue + ", should be Float");
|
188
|
+
}
|
127
189
|
if (annotation.coordinates == null)
|
128
|
-
annotation.coordinates = new Annotation.Coordinates(0,
|
190
|
+
annotation.coordinates = new Annotation.Coordinates(0, v);
|
129
191
|
else
|
130
|
-
annotation.coordinates.longitude =
|
192
|
+
annotation.coordinates.longitude = v;
|
131
193
|
}
|
132
194
|
else if (strKey.equals("title"))
|
133
|
-
annotation.title =
|
195
|
+
annotation.title = strValue;
|
134
196
|
else if (strKey.equals("subtitle"))
|
135
|
-
annotation.subtitle =
|
197
|
+
annotation.subtitle = strValue;
|
136
198
|
else if (strKey.equals("street_address"))
|
137
|
-
annotation.street_address =
|
199
|
+
annotation.street_address = strValue;
|
138
200
|
else if (strKey.equals("resolved_address"))
|
139
|
-
annotation.resolved_address =
|
201
|
+
annotation.resolved_address = strValue;
|
140
202
|
else if (strKey.equals("url"))
|
141
|
-
annotation.url =
|
203
|
+
annotation.url = strValue;
|
142
204
|
}
|
143
205
|
annotations.addElement(annotation);
|
144
206
|
}
|
@@ -242,38 +242,39 @@ NSMutableArray* parse_annotations(int nannotations, char** annotation) {
|
|
242
242
|
}
|
243
243
|
|
244
244
|
NSMutableArray* parse_settings(int nparams, char** params) {
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
245
|
+
if (nparams <= 0) return [NSMutableArray arrayWithCapacity:0];
|
246
|
+
NSMutableArray *settings = [NSMutableArray arrayWithCapacity:nparams];
|
247
|
+
BOOL array_flag = FALSE;
|
248
|
+
for(int i = 0; i < nparams; i++) {
|
249
|
+
if (params[i]) {
|
250
|
+
if (array_flag) {
|
251
|
+
NSMutableArray *arr = [NSMutableArray arrayWithCapacity:4];
|
252
|
+
char **array = (char**)params[i];
|
253
|
+
while(*array) {
|
254
|
+
char const *s = *array;
|
255
|
+
[arr addObject:[NSString stringWithCString:*array]];
|
256
|
+
array++;
|
257
|
+
printf("param %s\n", s);
|
258
|
+
}
|
259
|
+
array_flag = FALSE;
|
260
|
+
[settings addObject:arr];
|
261
|
+
} else {
|
262
|
+
if (strcmp(params[i],"region")==0)
|
263
|
+
array_flag = TRUE;
|
264
|
+
[settings addObject:[NSString stringWithCString:params[i]]];
|
265
|
+
printf("param %s\n", params[i]);
|
266
|
+
}
|
267
|
+
} else {
|
268
|
+
if (array_flag) {
|
269
|
+
array_flag = FALSE;
|
270
|
+
NSMutableArray *arr = [NSMutableArray arrayWithCapacity:1];
|
271
|
+
[settings addObject:arr];
|
272
|
+
} else {
|
273
|
+
[settings addObject:@""];
|
274
|
+
}
|
275
|
+
}
|
276
|
+
}
|
277
|
+
return settings;
|
277
278
|
}
|
278
279
|
|
279
280
|
#endif
|
@@ -97,8 +97,10 @@ char* get_current_location() {
|
|
97
97
|
|
98
98
|
-(void)navigateRedirect:(NSString*)url {
|
99
99
|
//RAWLOG_INFO1("Navigate (redirect) to: %s", [url cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
100
|
-
NSString* escapedUrl = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
101
|
-
NSString*
|
100
|
+
NSString* escapedUrl = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
101
|
+
NSString* homeurl = [NSString stringWithCString:rho_rhodesapp_gethomeurl() encoding:[NSString defaultCStringEncoding]];
|
102
|
+
NSString* redirector1 = [@"/system/redirect_to?url=" stringByAppendingString:escapedUrl];
|
103
|
+
NSString* redirector = [homeurl stringByAppendingString:redirector1];
|
102
104
|
[webView loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:redirector]]];
|
103
105
|
}
|
104
106
|
|