diff --git a/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs b/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs index bc2ca19..c461f46 100644 --- a/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +++ b/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs @@ -1,3 +1,19 @@ +/** + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /* eslint-disable */ //prettier-ignore module.exports = { diff --git a/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs b/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs index 4e89c7c..6d2f376 100644 --- a/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +++ b/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs @@ -1,3 +1,19 @@ +/** + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /* eslint-disable */ //prettier-ignore module.exports = { diff --git a/.yarn/releases/yarn-3.6.1.cjs b/.yarn/releases/yarn-3.6.1.cjs index 5227385..92eb34f 100755 --- a/.yarn/releases/yarn-3.6.1.cjs +++ b/.yarn/releases/yarn-3.6.1.cjs @@ -1,4 +1,20 @@ #!/usr/bin/env node +/** + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /* eslint-disable */ //prettier-ignore (()=>{var xge=Object.create;var lS=Object.defineProperty;var Pge=Object.getOwnPropertyDescriptor;var Dge=Object.getOwnPropertyNames;var kge=Object.getPrototypeOf,Rge=Object.prototype.hasOwnProperty;var J=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var Fge=(r,e)=>()=>(r&&(e=r(r=0)),e);var w=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ut=(r,e)=>{for(var t in e)lS(r,t,{get:e[t],enumerable:!0})},Nge=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Dge(e))!Rge.call(r,n)&&n!==t&&lS(r,n,{get:()=>e[n],enumerable:!(i=Pge(e,n))||i.enumerable});return r};var Pe=(r,e,t)=>(t=r!=null?xge(kge(r)):{},Nge(e||!r||!r.__esModule?lS(t,"default",{value:r,enumerable:!0}):t,r));var vK=w((JXe,SK)=>{SK.exports=QK;QK.sync=tfe;var BK=J("fs");function efe(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var i=0;i{kK.exports=PK;PK.sync=rfe;var xK=J("fs");function PK(r,e,t){xK.stat(r,function(i,n){t(i,i?!1:DK(n,e))})}function rfe(r,e){return DK(xK.statSync(r),e)}function DK(r,e){return r.isFile()&&ife(r,e)}function ife(r,e){var t=r.mode,i=r.uid,n=r.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,g=t&c||t&l&&n===o||t&a&&i===s||t&u&&s===0;return g}});var NK=w((VXe,FK)=>{var zXe=J("fs"),lI;process.platform==="win32"||global.TESTING_WINDOWS?lI=vK():lI=RK();FK.exports=SS;SS.sync=nfe;function SS(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){SS(r,e||{},function(s,o){s?n(s):i(o)})})}lI(r,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),t(i,n)})}function nfe(r,e){try{return lI.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var HK=w((XXe,UK)=>{var Dg=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",TK=J("path"),sfe=Dg?";":":",LK=NK(),MK=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),OK=(r,e)=>{let t=e.colon||sfe,i=r.match(/\//)||Dg&&r.match(/\\/)?[""]:[...Dg?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=Dg?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Dg?n.split(t):[""];return Dg&&r.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},KK=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=OK(r,e),o=[],a=c=>new Promise((u,g)=>{if(c===i.length)return e.all&&o.length?u(o):g(MK(r));let f=i[c],h=/^".*"$/.test(f)?f.slice(1,-1):f,p=TK.join(h,r),C=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+p:p;u(l(C,c,0))}),l=(c,u,g)=>new Promise((f,h)=>{if(g===n.length)return f(a(u+1));let p=n[g];LK(c+p,{pathExt:s},(C,y)=>{if(!C&&y)if(e.all)o.push(c+p);else return f(c+p);return f(l(c,u,g+1))})});return t?a(0).then(c=>t(null,c),t):a(0)},ofe=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:i,pathExtExe:n}=OK(r,e),s=[];for(let o=0;o{"use strict";var GK=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};vS.exports=GK;vS.exports.default=GK});var WK=w((_Xe,JK)=>{"use strict";var jK=J("path"),afe=HK(),Afe=YK();function qK(r,e){let t=r.options.env||process.env,i=process.cwd(),n=r.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(r.options.cwd)}catch{}let o;try{o=afe.sync(r.command,{path:t[Afe({env:t})],pathExt:e?jK.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return o&&(o=jK.resolve(n?r.options.cwd:"",o)),o}function lfe(r){return qK(r)||qK(r,!0)}JK.exports=lfe});var zK=w(($Xe,PS)=>{"use strict";var xS=/([()\][%!^"`<>&|;, *?])/g;function cfe(r){return r=r.replace(xS,"^$1"),r}function ufe(r,e){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(xS,"^$1"),e&&(r=r.replace(xS,"^$1")),r}PS.exports.command=cfe;PS.exports.argument=ufe});var XK=w((eZe,VK)=>{"use strict";VK.exports=/^#!(.*)/});var _K=w((tZe,ZK)=>{"use strict";var gfe=XK();ZK.exports=(r="")=>{let e=r.match(gfe);if(!e)return null;let[t,i]=e[0].replace(/#! ?/,"").split(" "),n=t.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var eU=w((rZe,$K)=>{"use strict";var DS=J("fs"),ffe=_K();function hfe(r){let t=Buffer.alloc(150),i;try{i=DS.openSync(r,"r"),DS.readSync(i,t,0,150,0),DS.closeSync(i)}catch{}return ffe(t.toString())}$K.exports=hfe});var nU=w((iZe,iU)=>{"use strict";var pfe=J("path"),tU=WK(),rU=zK(),dfe=eU(),Cfe=process.platform==="win32",mfe=/\.(?:com|exe)$/i,Efe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Ife(r){r.file=tU(r);let e=r.file&&dfe(r.file);return e?(r.args.unshift(r.file),r.command=e,tU(r)):r.file}function yfe(r){if(!Cfe)return r;let e=Ife(r),t=!mfe.test(e);if(r.options.forceShell||t){let i=Efe.test(e);r.command=pfe.normalize(r.command),r.command=rU.command(r.command),r.args=r.args.map(s=>rU.argument(s,i));let n=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${n}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function wfe(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let i={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?i:yfe(i)}iU.exports=wfe});var aU=w((nZe,oU)=>{"use strict";var kS=process.platform==="win32";function RS(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function Bfe(r,e){if(!kS)return;let t=r.emit;r.emit=function(i,n){if(i==="exit"){let s=sU(n,e,"spawn");if(s)return t.call(r,"error",s)}return t.apply(r,arguments)}}function sU(r,e){return kS&&r===1&&!e.file?RS(e.original,"spawn"):null}function bfe(r,e){return kS&&r===1&&!e.file?RS(e.original,"spawnSync"):null}oU.exports={hookChildProcess:Bfe,verifyENOENT:sU,verifyENOENTSync:bfe,notFoundError:RS}});var TS=w((sZe,kg)=>{"use strict";var AU=J("child_process"),FS=nU(),NS=aU();function lU(r,e,t){let i=FS(r,e,t),n=AU.spawn(i.command,i.args,i.options);return NS.hookChildProcess(n,i),n}function Qfe(r,e,t){let i=FS(r,e,t),n=AU.spawnSync(i.command,i.args,i.options);return n.error=n.error||NS.verifyENOENTSync(n.status,i),n}kg.exports=lU;kg.exports.spawn=lU;kg.exports.sync=Qfe;kg.exports._parse=FS;kg.exports._enoent=NS});var uU=w((oZe,cU)=>{"use strict";function Sfe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function Zl(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Zl)}Sfe(Zl,Error);Zl.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;g>",ie=me(">>",!1),de=">&",_e=me(">&",!1),Pt=">",It=me(">",!1),Mr="<<<",ii=me("<<<",!1),gi="<&",hr=me("<&",!1),fi="<",ni=me("<",!1),Ks=function(m){return{type:"argument",segments:[].concat(...m)}},pr=function(m){return m},Ii="$'",rs=me("$'",!1),fa="'",CA=me("'",!1),cg=function(m){return[{type:"text",text:m}]},is='""',mA=me('""',!1),ha=function(){return{type:"text",text:""}},wp='"',EA=me('"',!1),IA=function(m){return m},wr=function(m){return{type:"arithmetic",arithmetic:m,quoted:!0}},Tl=function(m){return{type:"shell",shell:m,quoted:!0}},ug=function(m){return{type:"variable",...m,quoted:!0}},Io=function(m){return{type:"text",text:m}},gg=function(m){return{type:"arithmetic",arithmetic:m,quoted:!1}},Bp=function(m){return{type:"shell",shell:m,quoted:!1}},bp=function(m){return{type:"variable",...m,quoted:!1}},vr=function(m){return{type:"glob",pattern:m}},se=/^[^']/,yo=Je(["'"],!0,!1),Fn=function(m){return m.join("")},fg=/^[^$"]/,bt=Je(["$",'"'],!0,!1),Ll=`\\ diff --git a/ios/react-native-navigation-sdk/NavAutoModule.m b/ios/react-native-navigation-sdk/NavAutoModule.m index 9d51e80..9842bb3 100644 --- a/ios/react-native-navigation-sdk/NavAutoModule.m +++ b/ios/react-native-navigation-sdk/NavAutoModule.m @@ -117,10 +117,8 @@ + (void)unregisterNavAutoModuleReadyCallback { }); } -RCT_EXPORT_METHOD(addMarker - : (NSDictionary *)markerOptions resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(addMarker : (NSDictionary *)markerOptions resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_viewController) { [self->_viewController addMarker:markerOptions @@ -133,10 +131,8 @@ + (void)unregisterNavAutoModuleReadyCallback { }); } -RCT_EXPORT_METHOD(addCircle - : (NSDictionary *)circleOptions resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(addCircle : (NSDictionary *)circleOptions resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_viewController) { [self->_viewController addCircle:circleOptions @@ -149,10 +145,8 @@ + (void)unregisterNavAutoModuleReadyCallback { }); } -RCT_EXPORT_METHOD(addPolyline - : (NSDictionary *)polylineOptions resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(addPolyline : (NSDictionary *)polylineOptions resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_viewController) { [self->_viewController addPolyline:polylineOptions @@ -165,10 +159,8 @@ + (void)unregisterNavAutoModuleReadyCallback { }); } -RCT_EXPORT_METHOD(addPolygon - : (NSDictionary *)polygonOptions resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(addPolygon : (NSDictionary *)polygonOptions resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_viewController) { [self->_viewController addPolygon:polygonOptions @@ -277,10 +269,8 @@ + (void)unregisterNavAutoModuleReadyCallback { }); } -RCT_EXPORT_METHOD(setZoomLevel - : (nonnull NSNumber *)level resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(setZoomLevel : (nonnull NSNumber *)level resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_viewController) { [self->_viewController setZoomLevel:level]; @@ -314,9 +304,8 @@ + (void)unregisterNavAutoModuleReadyCallback { }); } -RCT_EXPORT_METHOD(getCameraPosition - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getCameraPosition : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_viewController) { [self->_viewController getCameraPosition:^(NSDictionary *result) { @@ -328,9 +317,8 @@ + (void)unregisterNavAutoModuleReadyCallback { }); } -RCT_EXPORT_METHOD(getMyLocation - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getMyLocation : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock) + reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_viewController) { [self->_viewController getMyLocation:^(NSDictionary *_Nullable result) { @@ -342,9 +330,8 @@ + (void)unregisterNavAutoModuleReadyCallback { }); } -RCT_EXPORT_METHOD(getUiSettings - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getUiSettings : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock) + reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_viewController) { [self->_viewController getUiSettings:^(NSDictionary *_Nullable result) { @@ -356,9 +343,8 @@ + (void)unregisterNavAutoModuleReadyCallback { }); } -RCT_EXPORT_METHOD(isMyLocationEnabled - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(isMyLocationEnabled : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_viewController) { [self->_viewController isMyLocationEnabled:^(BOOL result) { @@ -378,20 +364,16 @@ + (void)unregisterNavAutoModuleReadyCallback { }); } -RCT_EXPORT_METHOD(isAutoScreenAvailable - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(isAutoScreenAvailable : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ BOOL hasViewController = self->_viewController != nil; resolve([NSNumber numberWithBool:hasViewController]); }); } -RCT_EXPORT_METHOD(setPadding - : (nonnull NSNumber *)top left - : (nonnull NSNumber *)left bottom - : (nonnull NSNumber *)bottom right - : (nonnull NSNumber *)right) { +RCT_EXPORT_METHOD(setPadding : (nonnull NSNumber *)top left : (nonnull NSNumber *) + left bottom : (nonnull NSNumber *)bottom right : (nonnull NSNumber *)right) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_viewController) { [self->_viewController setPadding:UIEdgeInsetsMake(top.floatValue, left.floatValue, diff --git a/ios/react-native-navigation-sdk/NavModule.m b/ios/react-native-navigation-sdk/NavModule.m index 81b1d3e..2958408 100644 --- a/ios/react-native-navigation-sdk/NavModule.m +++ b/ios/react-native-navigation-sdk/NavModule.m @@ -151,8 +151,7 @@ - (void)showTermsAndConditionsDialog { }]; } -RCT_EXPORT_METHOD(initializeNavigator - : (NSDictionary *)options +RCT_EXPORT_METHOD(initializeNavigator : (NSDictionary *)options // taskRemovedBehaviourValue is Android only value and not used on iOS. : (nonnull NSNumber *)taskRemovedBehaviourValue) { dispatch_async(dispatch_get_main_queue(), ^{ @@ -161,9 +160,8 @@ - (void)showTermsAndConditionsDialog { }); } -RCT_EXPORT_METHOD(cleanup - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(cleanup : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock) + reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_session == nil) { reject(@"session_not_initialized", @"Navigation session not initialized", nil); @@ -199,9 +197,8 @@ - (void)showTermsAndConditionsDialog { }); } -RCT_EXPORT_METHOD(getCurrentTimeAndDistance - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getCurrentTimeAndDistance : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ GMSNavigator *navigator = nil; if (![self checkNavigatorWithError:reject navigator:&navigator]) { @@ -221,10 +218,8 @@ - (void)showTermsAndConditionsDialog { }); } -RCT_EXPORT_METHOD(setAudioGuidanceType - : (nonnull NSNumber *)index resolve - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(setAudioGuidanceType : (nonnull NSNumber *)index resolve : ( + RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ GMSNavigator *navigator = nil; if (![self checkNavigatorWithError:reject navigator:&navigator]) { @@ -243,9 +238,8 @@ - (void)showTermsAndConditionsDialog { }); } -RCT_EXPORT_METHOD(startGuidance - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(startGuidance : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock) + reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (self->_destinations != NULL) { GMSNavigator *navigator = nil; @@ -263,9 +257,8 @@ - (void)showTermsAndConditionsDialog { }); } -RCT_EXPORT_METHOD(stopGuidance - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(stopGuidance : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock) + reject) { dispatch_async(dispatch_get_main_queue(), ^{ GMSNavigator *navigator = nil; if (![self checkNavigatorWithError:reject navigator:&navigator]) { @@ -294,9 +287,8 @@ - (void)showTermsAndConditionsDialog { }); } -RCT_EXPORT_METHOD(clearDestinations - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(clearDestinations : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ GMSNavigator *navigator = nil; if (![self checkNavigatorWithError:reject navigator:&navigator]) { @@ -309,9 +301,8 @@ - (void)showTermsAndConditionsDialog { }); } -RCT_EXPORT_METHOD(continueToNextDestination - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(continueToNextDestination : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ GMSNavigator *navigator = nil; if (![self checkNavigatorWithError:reject navigator:&navigator]) { @@ -323,26 +314,31 @@ - (void)showTermsAndConditionsDialog { }); } -RCT_EXPORT_METHOD(setDestination - : (nonnull NSDictionary *)waypoint routingOptions - : (NSDictionary *)routingOptions displayOptions - : (NSDictionary *)displayOptions resolve - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +/** + * Sets destinations for navigation using either a route token or standard routing. + * @param waypoints Array of destination points + * @param routingOptions Dictionary of routing preferences + * @param displayOptions Dictionary of display settings + * @param routeToken Optional token for pre-calculated route + * @param resolve Promise resolve callback + * @param reject Promise reject callback + */ + +RCT_EXPORT_METHOD(setDestination : (nonnull NSDictionary *)waypoint : (NSDictionary *) + routingOptions : (NSDictionary *)displayOptions : (NSString *)routeToken : ( + RCTPromiseResolveBlock)resolve : (RCTPromiseRejectBlock)reject) { NSArray *waypoints = @[ waypoint ]; - [self setDestinations:waypoints - routingOptions:routingOptions - displayOptions:displayOptions - resolve:resolve - rejecter:reject]; -} - -RCT_EXPORT_METHOD(setDestinations - : (nonnull NSArray *)waypoints routingOptions - : (NSDictionary *)routingOptions displayOptions - : (NSDictionary *)displayOptions resolve - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { + [self setDestination:waypoints:routingOptions:displayOptions:routeToken:resolve:reject]; +} + +RCT_EXPORT_METHOD(setDestinations : (nonnull NSArray *)waypoints : (NSDictionary *) + routingOptions : (NSDictionary *)displayOptions : (NSString *)routeToken : ( + RCTPromiseResolveBlock)resolve : (RCTPromiseRejectBlock)reject) { +#if DEBUG + NSLog(@"[NavModule] Setting destinations with routeToken: %@", routeToken); + NSLog(@"[NavModule] Waypoints: %@", waypoints); + NSLog(@"[NavModule] Routing options: %@", routingOptions); +#endif __weak typeof(self) weakSelf = self; dispatch_async(dispatch_get_main_queue(), ^{ __strong typeof(self) strongSelf = weakSelf; @@ -399,7 +395,12 @@ - (void)showTermsAndConditionsDialog { resolve(@(YES)); }; - if (routingOptions != NULL) { + if (routeToken != nil && ![routeToken isEqualToString:@""]) { + NSLog(@"[NavModule] Using routeToken for navigation"); + [navigator setDestinations:strongSelf->_destinations + routeToken:routeToken + callback:routeStatusCallback]; + } else if (routingOptions != NULL) { [strongSelf configureNavigator:navigator withRoutingOptions:routingOptions]; [navigator setDestinations:strongSelf->_destinations routingOptions:[NavModule getRoutingOptions:routingOptions] @@ -462,9 +463,8 @@ - (void)configureNavigator:(GMSNavigator *)navigator }); } -RCT_EXPORT_METHOD(getCurrentRouteSegment - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getCurrentRouteSegment : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ GMSNavigator *navigator = nil; if (![self checkNavigatorWithError:reject navigator:&navigator]) { @@ -487,9 +487,8 @@ - (void)configureNavigator:(GMSNavigator *)navigator }); } -RCT_EXPORT_METHOD(getRouteSegments - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getRouteSegments : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ GMSNavigator *navigator = nil; if (![self checkNavigatorWithError:reject navigator:&navigator]) { @@ -512,9 +511,8 @@ - (void)configureNavigator:(GMSNavigator *)navigator }); } -RCT_EXPORT_METHOD(getTraveledPath - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getTraveledPath : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ GMSNavigator *navigator = nil; if (![self checkNavigatorWithError:reject navigator:&navigator]) { @@ -531,10 +529,8 @@ - (void)configureNavigator:(GMSNavigator *)navigator }); } -RCT_EXPORT_METHOD(setSpeedAlertOptions - : (NSDictionary *)thresholds resolve - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(setSpeedAlertOptions : (NSDictionary *)thresholds resolve : ( + RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ GMSNavigator *navigator = nil; if (![self checkNavigatorWithError:reject navigator:&navigator]) { @@ -592,9 +588,8 @@ - (void)configureNavigator:(GMSNavigator *)navigator }); } -RCT_EXPORT_METHOD(areTermsAccepted - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(areTermsAccepted : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ if (GMSNavigationServices.areTermsAndConditionsAccepted == NO) { resolve(@"false"); @@ -604,9 +599,8 @@ - (void)configureNavigator:(GMSNavigator *)navigator }); } -RCT_EXPORT_METHOD(getNavSDKVersion - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getNavSDKVersion : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ resolve(GMSNavigationServices.navSDKVersion); }); diff --git a/ios/react-native-navigation-sdk/NavViewModule.m b/ios/react-native-navigation-sdk/NavViewModule.m index e8bc85c..315f4bf 100644 --- a/ios/react-native-navigation-sdk/NavViewModule.m +++ b/ios/react-native-navigation-sdk/NavViewModule.m @@ -54,10 +54,8 @@ - (NavViewController *)getViewControllerForTag:(NSNumber *)reactTag { return viewController; } -RCT_EXPORT_METHOD(getCameraPosition - : (nonnull NSNumber *)reactTag resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getCameraPosition : (nonnull NSNumber *)reactTag resolver : ( + RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; if (viewController) { @@ -70,10 +68,8 @@ - (NavViewController *)getViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(getMyLocation - : (nonnull NSNumber *)reactTag resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getMyLocation : (nonnull NSNumber *)reactTag resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; if (viewController) { @@ -86,10 +82,8 @@ - (NavViewController *)getViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(getUiSettings - : (nonnull NSNumber *)reactTag resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(getUiSettings : (nonnull NSNumber *)reactTag resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; if (viewController) { @@ -102,10 +96,8 @@ - (NavViewController *)getViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(isMyLocationEnabled - : (nonnull NSNumber *)reactTag resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(isMyLocationEnabled : (nonnull NSNumber *)reactTag resolver : ( + RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; if (viewController) { @@ -118,11 +110,9 @@ - (NavViewController *)getViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(addMarker - : (nonnull NSNumber *)reactTag markerOptions - : (NSDictionary *)markerOptions resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(addMarker : (nonnull NSNumber *)reactTag markerOptions : (NSDictionary *) + markerOptions resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; if (viewController) { @@ -136,11 +126,9 @@ - (NavViewController *)getViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(addPolyline - : (nonnull NSNumber *)reactTag polylineOptions - : (NSDictionary *)polylineOptions resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(addPolyline : (nonnull NSNumber *)reactTag polylineOptions : (NSDictionary *) + polylineOptions resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; if (viewController) { @@ -154,11 +142,9 @@ - (NavViewController *)getViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(addPolygon - : (nonnull NSNumber *)reactTag polygonOptions - : (NSDictionary *)polygonOptions resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(addPolygon : (nonnull NSNumber *)reactTag polygonOptions : (NSDictionary *) + polygonOptions resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; if (viewController) { @@ -172,11 +158,9 @@ - (NavViewController *)getViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(addCircle - : (nonnull NSNumber *)reactTag circleOptions - : (NSDictionary *)circleOptions resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(addCircle : (nonnull NSNumber *)reactTag circleOptions : (NSDictionary *) + circleOptions resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; if (viewController) { @@ -190,11 +174,9 @@ - (NavViewController *)getViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(addGroundOverlay - : (nonnull NSNumber *)reactTag overlayOptions - : (NSDictionary *)overlayOptions resolver - : (RCTPromiseResolveBlock)resolve rejecter - : (RCTPromiseRejectBlock)reject) { +RCT_EXPORT_METHOD(addGroundOverlay : (nonnull NSNumber *)reactTag overlayOptions : (NSDictionary *) + overlayOptions resolver : (RCTPromiseResolveBlock) + resolve rejecter : (RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; if (viewController) { diff --git a/ios/react-native-navigation-sdk/RCTNavViewManager.m b/ios/react-native-navigation-sdk/RCTNavViewManager.m index 26413a9..590ba7d 100644 --- a/ios/react-native-navigation-sdk/RCTNavViewManager.m +++ b/ios/react-native-navigation-sdk/RCTNavViewManager.m @@ -74,10 +74,8 @@ - (void)unregisterViewControllerForTag:(NSNumber *)reactTag { } } -RCT_EXPORT_METHOD(createFragment - : (nonnull NSNumber *)reactTag stylingOptions - : (NSDictionary *)stylingOptions fragmentType - : (NSInteger)fragmentType) { +RCT_EXPORT_METHOD(createFragment : (nonnull NSNumber *)reactTag stylingOptions : (NSDictionary *) + stylingOptions fragmentType : (NSInteger)fragmentType) { [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { NavView *view = (NavView *)viewRegistry[reactTag]; @@ -110,36 +108,32 @@ - (void)unregisterViewControllerForTag:(NSNumber *)reactTag { }]; } -RCT_EXPORT_METHOD(moveCamera - : (nonnull NSNumber *)reactTag cameraPosition - : (NSDictionary *)cameraPosition) { +RCT_EXPORT_METHOD(moveCamera : (nonnull NSNumber *)reactTag cameraPosition : (NSDictionary *) + cameraPosition) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController moveCamera:cameraPosition]; }); } -RCT_EXPORT_METHOD(setTripProgressBarEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setTripProgressBarEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setTripProgressBarEnabled:isEnabled]; }); } -RCT_EXPORT_METHOD(setNavigationUIEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setNavigationUIEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setNavigationUIEnabled:isEnabled]; }); } -RCT_EXPORT_METHOD(setFollowingPerspective - : (nonnull NSNumber *)reactTag index - : (nonnull NSNumber *)index) { +RCT_EXPORT_METHOD(setFollowingPerspective : (nonnull NSNumber *) + reactTag index : (nonnull NSNumber *)index) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setFollowingPerspective:index]; @@ -153,27 +147,24 @@ - (void)unregisterViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(setSpeedometerEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setSpeedometerEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setSpeedometerEnabled:isEnabled]; }); } -RCT_EXPORT_METHOD(setSpeedLimitIconEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setSpeedLimitIconEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setSpeedLimitIconEnabled:isEnabled]; }); } -RCT_EXPORT_METHOD(setRecenterButtonEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setRecenterButtonEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setRecenterButtonEnabled:isEnabled]; @@ -215,9 +206,8 @@ - (void)unregisterViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(removeGroundOverlay - : (nonnull NSNumber *)reactTag params - : (NSString *)overlayId) { +RCT_EXPORT_METHOD(removeGroundOverlay : (nonnull NSNumber *)reactTag params : (NSString *) + overlayId) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController removeGroundOverlay:overlayId]; @@ -253,9 +243,8 @@ - (void)unregisterViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(setMyLocationButtonEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setMyLocationButtonEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setMyLocationButtonEnabled:isEnabled]; @@ -269,45 +258,40 @@ - (void)unregisterViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(setRotateGesturesEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setRotateGesturesEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setRotateGesturesEnabled:isEnabled]; }); } -RCT_EXPORT_METHOD(setScrollGesturesEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setScrollGesturesEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setScrollGesturesEnabled:isEnabled]; }); } -RCT_EXPORT_METHOD(setScrollGesturesEnabledDuringRotateOrZoom - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setScrollGesturesEnabledDuringRotateOrZoom : (nonnull NSNumber *) + reactTag isEnabled : (BOOL)isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setScrollGesturesEnabledDuringRotateOrZoom:isEnabled]; }); } -RCT_EXPORT_METHOD(setTiltGesturesEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setTiltGesturesEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setTiltGesturesEnabled:isEnabled]; }); } -RCT_EXPORT_METHOD(setZoomGesturesEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setZoomGesturesEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setZoomGesturesEnabled:isEnabled]; @@ -321,9 +305,8 @@ - (void)unregisterViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(setTrafficIncidentCardsEnabled - : (nonnull NSNumber *)reactTag isEnabled - : (BOOL)isEnabled) { +RCT_EXPORT_METHOD(setTrafficIncidentCardsEnabled : (nonnull NSNumber *)reactTag isEnabled : (BOOL) + isEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setTrafficIncidentCardsEnabled:isEnabled]; @@ -351,10 +334,8 @@ - (void)unregisterViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(animateCamera - : (nonnull NSNumber *)reactTag latitude - : (nonnull NSNumber *)latitude longitude - : (nonnull NSNumber *)longitude) { +RCT_EXPORT_METHOD(animateCamera : (nonnull NSNumber *)reactTag latitude : (nonnull NSNumber *) + latitude longitude : (nonnull NSNumber *)longitude) { dispatch_async(dispatch_get_main_queue(), ^{ GMSCameraPosition *cameraPosition = [GMSCameraPosition cameraWithLatitude:[latitude doubleValue] @@ -366,10 +347,8 @@ - (void)unregisterViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(setMapStyle - : (nonnull NSNumber *)reactTag jsonStyleString - : (NSString *)jsonStyleString debugCallback - : (RCTResponseSenderBlock)debugCallback) { +RCT_EXPORT_METHOD(setMapStyle : (nonnull NSNumber *)reactTag jsonStyleString : (NSString *) + jsonStyleString debugCallback : (RCTResponseSenderBlock)debugCallback) { dispatch_async(dispatch_get_main_queue(), ^{ NSError *error; GMSMapStyle *mapStyle = [GMSMapStyle styleWithJSONString:jsonStyleString error:&error]; @@ -426,12 +405,8 @@ - (void)unregisterViewControllerForTag:(NSNumber *)reactTag { }); } -RCT_EXPORT_METHOD(setPadding - : (nonnull NSNumber *)reactTag top - : (nonnull NSNumber *)top left - : (nonnull NSNumber *)left bottom - : (nonnull NSNumber *)bottom right - : (nonnull NSNumber *)right) { +RCT_EXPORT_METHOD(setPadding : (nonnull NSNumber *)reactTag top : (nonnull NSNumber *)top left : ( + nonnull NSNumber *)left bottom : (nonnull NSNumber *)bottom right : (nonnull NSNumber *)right) { dispatch_async(dispatch_get_main_queue(), ^{ NavViewController *viewController = [self getViewControllerForTag:reactTag]; [viewController setPadding:UIEdgeInsetsMake(top.floatValue, left.floatValue, bottom.floatValue, diff --git a/src/navigation/navigation/types.ts b/src/navigation/navigation/types.ts index bf6028b..c14f35d 100644 --- a/src/navigation/navigation/types.ts +++ b/src/navigation/navigation/types.ts @@ -315,7 +315,8 @@ export interface NavigationController { setDestination( waypoint: Waypoint, routingOptions?: RoutingOptions, - displayOptions?: DisplayOptions + displayOptions?: DisplayOptions, + routeToken?: string ): Promise; /** @@ -327,7 +328,8 @@ export interface NavigationController { setDestinations( waypoints: Waypoint[], routingOptions?: RoutingOptions, - displayOptions?: DisplayOptions + displayOptions?: DisplayOptions, + routeToken?: string ): Promise; /** diff --git a/src/navigation/navigation/useNavigationController.ts b/src/navigation/navigation/useNavigationController.ts index 17df257..102c55c 100644 --- a/src/navigation/navigation/useNavigationController.ts +++ b/src/navigation/navigation/useNavigationController.ts @@ -95,24 +95,28 @@ export const useNavigationController = ( setDestination: async ( waypoint: Waypoint, routingOptions?: RoutingOptions, - displayOptions?: DisplayOptions + displayOptions?: DisplayOptions, + routeToken?: string ) => { return await NavModule.setDestination( waypoint, routingOptions, - displayOptions + displayOptions, + routeToken ); }, setDestinations: async ( waypoints: Waypoint[], routingOptions?: RoutingOptions, - displayOptions?: DisplayOptions + displayOptions?: DisplayOptions, + routeToken?: string ) => { return await NavModule.setDestinations( waypoints, routingOptions, - displayOptions + displayOptions, + routeToken ); },