how to copy folder in cloudme programmatically - iphone

i want to make my iphone app can connect to some webdav server using flycode in this site , i've done with all implementation, but i have problem in copying folder in cloudme server. I dont have this problem in another webdav server. The response code i have in this process is 403, and the response strings are :
response string :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 403 COPY needs a file as source</title>
</head>
<body>
<h2>HTTP ERROR: 403</h2>
<p>Problem accessing /myApp/xios/Documents/myDirectory///. Reason:
<pre> COPY needs a file as source</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>
this is the code that i use to called copy method in flying code webdav :
NSURL *urlFrom = [[NSURL alloc] initWithScheme:#"https" host:[prefs objectForKey:#"idiskhost"] path:fromPath];
NSURL *urlTo = [[NSURL alloc] initWithScheme:#"https" host:[prefs objectForKey:#"idiskhost"] path:[NSString stringWithFormat:#"%#/",forPath]];
[[[MyAppWebDAVRequest requestToURL:urlFrom] synchronous] copyToDestinationURL:urlTo];
did cloudme support for copy folder? or am i did something wrong with the code?

I have solve this case, the problem is CloudMe didn't give any permission to copy a folder, I now this from the system response log.

Related

Flutter web event listener on other windows

I have a flutter web application, Im trying to implement Okta oauth2 but whenever I call the url that I manage to create with some params using DIO package I end up with having html response instead of the actual response.
The endpoint I'm calling looks like this:
https://dev-xxxxxxxx.okta.com/oauth2/default/v1/authorize?response_type=code&scope=openid+profile+offline_access&client_id=xxxxxxxxxxxxxxxxxxxx&redirect_uri=http://localhost:8080/authorization-code/callback&code_challenge_method=S256&code_challenge=Wag0u2fyeYWJHy_baK-XbMWO9H2xwUBii7R4Nvj761Y&sessionToken=20111jWBb2P2BoPIL-Atd0pk5QDImstT7EmYULPFMg2GoCGPgOrxKFl&state=X7hih1mUow&nonce=lSfF1CxmmR
Whenever I call this url it shall be redirected to another url such as:
http://localhost:8080/authorization-code/callback?code=TCifQEab0a6HwEGeWQXlDQhPm22RlyemvO5GbipASEU&state=YLi4I2P4qd
So the main point using DIO is that its returning the response of the second url which is an html flutter content.
It can be solved if DIO don't follow the redirection and give status code 302 but its not doing that.
Currently I'm trying different approach, I'm trying to open the url in a new window which immediately change to the second url.
My problem is how should I get the code from the second url and the cookies that the second url provide from the new opened window.
final html.WindowBase newWindow = html.window.open(url, "callback");
so at least how can I get the href from the newly opened window knowing that it changes after a while into the the flutter correct rout that I sat up.
Knowing that newWidnow.location.href is write only.
Okay I managed to solve that, leaving the solution if anyone faced the same issue.
under your /web directory create an html file and call it for example callback.html.
then paste this code inside it.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Auth</title>
<meta name="description"
content="Simple, quick, standalone responsive placeholder without any additional resources">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h2>Authentication Succeeded</h2>
<h3>Close this window if it didn't close by itself.</h3>
</body>
<script>
window.opener.postMessage(window.location.href, '*');
</script>
</html>
then set your Redirect URI as follows http://localhost:8080/callback.html
So in that case whenever you get the Redirect URI from oauth2 you get it as follows
http://localhost:8080/callback.html?code=TCifQEab0a6HwEGeWQXlDQhPm22RlyemvO5GbipASEU&state=YLi4I2P4qd
which will basically call the newly created html file callback.html.
In flutter side you'll need to do the following:
html.WindowBase popupWindow;
popupWindow = html.window.open(
url,
"Auth",
"width=400, height=500, scrollbars=yes",
);
String? code;
html.window.onMessage.listen((event) {
if (event.data.toString().contains('code=')) {
code = event.data.toString().split('code=')[1].split('&')[0];
}
});
await Future.delayed(const Duration(seconds: 2), () {
popupWindow.close();
});
Which will basically open the window, then capture the url and extract it, then close the window.
I hope this helps.
Use assign on Location to redirect to the Authorize endpoint of the Authorization Server.
window.location.assign('https://${yourOktaDomain}/oauth2/default/v1/authorize?...');

First line in URL list must be TsvHttpData-1.0 but it is Google Cloud Transfer Service Error

I am trying to import some csv files from Google Cloud to Google Cloud Storage(GCS), but I am getting the error. I can't seem to find what I did wrong. Please help!
URL List - https://drive.google.com/file/d/1gDWYfjr2FhSLTHUunQ5cBFmW82PR1vd5/view?usp=sharing
Error - First line in URL list must be TsvHttpData-1.0 but it is: <!DOCTYPE html><html><head><meta name="google" content="notranslate"><meta http-equiv="X-UA-Compatible" content="IE=edge;"><style nonce="b0Ey8uWci6arZ81yZ1/Xyw">#font-face{font-family:'Roboto';font-style:italic;font-weight:400;src:url(//fonts.gstatic.com/s/roboto/v18/KFOkCnqEu92Fr1Mu51xIIzc.ttf)format('truetype');}#font-face{font-family:'Roboto';font-style:normal;font-weight:300;src:url(//fonts.gstatic.com/s/roboto/v18/KFOlCnqEu92Fr1MmSU5fBBc9.ttf)format('truetype');}#font-face{font-family:'Roboto';font-style:normal;font-weight:400;src:url(//fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxP.ttf)format('truetype');}#font-face{font-family:'Roboto';font-style:normal;font-weight:500;src:url(//fonts.gstatic.com/s/roboto/v18/KFOlCnqEu92Fr1MmEU9fBBc9.ttf)format('truetype');}#font-face{font-family:'Roboto';font-style:normal;font-weight:700;src:url(//fonts.gstatic.com/s/roboto/v18/KFOlCnqEu92Fr1MmWUlfBBc9.ttf)format('truetype');}</style><meta name="referrer" content="origin"><title>URL_List.txt - Google Drive</title><meta property="og:title" content="URL_List.txt"><meta property="og:type" content="article"><meta property="og:site_name" content="Google Docs"><meta property="og:url" content="https://drive.google.com/file/d/1gDWYfjr2FhSLTHUunQ5cBFmW82PR1vd5/view?usp=sharing&usp=embed_facebook"><meta property="og:image" content="https://lh3.googleusercontent.com/4l6lCAvBKyWxCy42RcB_Y5_1vguKdkscpR8YAUHKTOb4hD8dYH_vrnRxTxMqowI8Zys=w1200-h630-p"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><link rel="shortcut icon" href="https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Google+Sans:300,400,500,700" nonce="b0Ey8uWci6arZ81yZ1/Xyw"><link rel="stylesheet" href="https://www.gstatic.com/_/apps-fileview/_/ss/k=apps-fileview.v.SN2xzHUByys.L.W.O/d=0/rs=AO0039uV2v8KOuxcH9eYr8HNmTKU5aI9VQ" nonce="b0Ey8uWci6arZ81yZ1/Xyw"><script nonce="i7nJhbgQY3EllroO23kuQg">_docs_flag_initialData={"docs-ails":"docs_cold","docs-fwds":"docs_sdf","docs-crs":"docs_crs_nfd","docs-shdn":0,"docs-tfh":"","info_params":{},"docos-eddmh":false,"docs-eohmo":false,"uls":"","docs-obsImUrl":"https://ssl.gstatic.com/docs/common/netcheck.gif","docs-api-keys":{},"buildLabel":"texmex_2022.16-Thu_RC00","docs-show_debug_info":false,"ondlburl":"https://docs.google.com","drive_url":"https://drive.google.com","app_url":"https://drive.google.com/file/","docs-itrf":false,"docs-gsmd":"","docs-eidfc":false,"docs-ecpvib":false,"docs-msid":32767,"docs-rid":1024,"docs-mif":1000,"docs-icdmt":[],"docs-mip":6250000,"docs-rawff":2,"docs-mib":5242880,"docs-mid":2048,"docs-sup":"/file","docs-seu":"https://drive.google.com/file/d/1gDWYfjr2FhSLTHUunQ5cBFmW82PR1vd5/edit","docs-crp":"/file/d/1gDWYfjr2FhSLTHUunQ5cBFmW82PR1vd5/view","docs-crq":"usp\u003dsharing","docs-ecvca":true,"docs-uptc":["lsrp","ca","sh","noreplica","ouid","dl","hi","hi_ext","usp","urp","utm_source","utm_medium","utm_campaign","utm_term","utm_content","aaac","sle"],"docs-doddn":"","docs-uddn":"","docs-cwsd":"","docs-epq":false,"docs-erdiiv":false,"docs-acap":["docs.security.access_capabilities",1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0],"docs-eefufs":false,"docs-eccfs":false,"docs-eefufd":false,"docs-hwg":"DISABLED","docs-hwst":"","docs-ndt":"Untitled Texmex","docs-prn":"","docs-een":false,"docs-as":"","docs-etdimo":false,"docs-mdck":"","docs-etiff":false,"docs-mriim":1800000,"docs-eccbs":false,"docs-rlmp":false,"docs-mmpt":15000,"docs-erd":false,"docs-erfar":false,"docs-ensb":false,"docs-ddts":false,"docs-uootuns":false,"docs-amawso":false,"docs-ofmpp":false,"docs-anlpfdo":false,"docs-eslars":true,"docs-eem":false,"docs-phe":"https://contacts.google.com","docs-wsu":"","docs-wsup":"","docs-pse":"PROD","docs-sccfo":"PROD","docs-eridm":false,"docs-pid":"","docs-eedmlf":false,"docs-emmda":false,"docs-efs":false,"docs-net-edsle":false,"docs-ricocpb":false,"docs-epmdup":false,"docs-rdowr":false,"docs-erep":false,"docs-effnp":false,"docs-cttmtbr":0,"docs-caaffso":true,"docs-eaaswoc":false,"docs-edpsf":true,"docs-edp":false,"docs-edlo":false,"docs-cttmteq":0,"docos-edces":false,"docs-dec":false,"docs-eiasrpu":false,"docs-ectt":false,"docs-ebbouf":false,"docs-ecgd":false,"docs-pcfloc":false,"docs-dsps":false,"docs-embmd":false,"docs-eesce":false,"docs-esmr":false,"docs-eawflb":false,"docs-iosdl":false,"docs-hft":"","docs-ececs":false,"docs-enfa":false,"docs-eerp":false,"docs-ecurf":false,"docs-efsii":false,"docs-plimif":6.0,"docs-elcfd":false,"docs-edmitm":false,"docs-enjec":false,"ecid":true,"docs-eir":false,"docs-eibs":false,"docs-mcciiu":false,"docs-hcwidu":false,"server_time_ms":1651222446455,"gaia_session_id":"","app-bc":"#d1d1d1","enable_iframed_embed_api":true,"docs-fut":"https://drive.google.com#folders/{folderId}","docs-isb":false,"docs-agdc":false,"docs-anddc":true,"docs-adndldc":false,"docs-dhnap":"drive.google.com","docs-ds":"https","docs-text-efnma":false,"docs-text-efrnma":false,"docs-cide":true,"docs-cn":"","docs-depquafr":false,"docs-frbanmc":false,"docs-rldce":false,"docs-dom":false,"docs-ecsup":false,"docs-edamc":false,"docs-edomic":false,"docs-eddm":false,"kix-edrat":false,"kix-edratv2":false,"docs-edhqlfr":false,"docs-eehlb":false,"docs-fwd":false,"docs-efpgwb":false,"docs-efu":false,"docs-eiecr":false,"docs-eiccp":false,"docs-elds":false,"docs-eph":false,"docs-epat":true,"docs-eppd":false,"docs-essph":false,"docs-tdd":false,"docs-rsc":"","docs-rgifem":true,"docs-ssi":false,"docs-uoci":"","docs-wia":"","docs-gth":"","docs-ef":false,"docs-ndsom":[],"docs-dm":"text/plain","docs-sdsom":[],"docs-po":"https://drive.google.com","docs-to":"https://drive.google.com","docs-eastd":true,"opendv":false,"onePickImportDocumentUrl":"","opmbs":5242880,"opmpd":2500,"opbu":"https://docs.google.com/picker","opru":"https://drive.google.com/relay.html","opdu":false,"opccp":false,"ophi":"texmex","opst":"","opuci":"","docs-eopiiv2":true,"projector_base_url":"//drive.google.com","docs-drk":[],"docs-erkpp":false,"docs-erkfsu":true,"jobset":"prod","docs-eqam":false,"docs-ehlib":false,"docs-efcm":false,"docs-euaool":false,"docs-eua":false,"docs-ebfgf":false,"docs-ehib":false,"docs-uahnt":"","docs-esap":false,"docs-efib":false,"docs-eidib":false,"docs-se":false,"docs-eisib":false,"docs-egf":false,"docs-uptuf":true,"docs-eodpb":true,"docs-odpl":false,"docs-surfb":false,"docs-odpdu":[null,null,null,"//drive.google.com/odp/dialog"],"docs-odpu":[null,null,null,"//drive.google.com/odp/embed"],"docs-dafjera":false,"docs-daflia":false,"docs-dafwsa":false,"docs-dafgfma":false,"docs-fta-fnrhci":false,"docs-spdy":true,"xdbcfAllowHostNamePrefix":true,"xdbcfAllowXpc":true,"docs-dbctc":false,"docs-iror":true,"docs-eirj":false,"promo_url":"","promo_second_url":"","promo_title":"","promo_title_prefix":"","promo_content_html":"","promo_more_element_text":"","promo_second_more_element_text":"","promo_element_id":"","promo_orientation":1,"promo_arrow_alignment":0,"promo_show_on_click":false,"promo_hide_arrow":false,"promo_show_on_load":false,"promo_mark_dismissed_on_show":false,"promo_use_material_styling":false,"promo_close_button_text":"","promo_icon_url":"","promo_action_id":"","promo_impression_id":0,"promo_is_contextual":false,"docs-ccwt":80,"docs-epcc":false,"docs-eoodwflb":false,"docs-era":true,"docs-msoil":"docs_spanner","docs-gsoil":"docs_gsabs","docs-fsd":false}; _docs_flag_cek= null ; if (window['DOCS_timing']) {DOCS_timing['ifdld']=new Date().getTime();}</script><script nonce="i7nJhbgQY3EllroO23kuQg">window.viewerData = {config: {'id': '1gDWYfjr2FhSLTHUunQ5cBFmW82PR1vd5', 'title': 'URL_List.txt', 'isItemTrashed': false , 'documentResourceKey': '','enableEmbedDialog': true,'projectorFeedbackId': '99950', 'projectorFeedbackBucket': 'viewer-web',}, configJson: ["",null,null,null,null,1,null,null,null,1,1,[1,null,null,"AIzaSyDVQw45DwoYh632gvsP5vPDqEKvb-Ywnb8",0,null,1,null,null,"AIzaSyC1eQ1xj69IdTMeii5r7brs3R90eck-m7k",null,"/drive/v2beta",0,0,1,[0],null,1,null,0,1,1],null,5,1,null,null,1,"https://drive.google.com",null,null,1,null,1,null,null,null,null,null,1,null,null,[[null,"0"],6,1,1,null,null,null,1],null,1,null,null,[null,null,null,null,"https://accounts.google.com/ServiceLogin?service\u003dwise\u0026passive\u003d1209600\u0026continue\u003dhttps://drive.google.com/file/d/1gDWYfjr2FhSLTHUunQ5cBFmW82PR1vd5/view?usp%3Dsharing\u0026hl\u003den\u0026followup\u003dhttps://drive.google.com/file/d/1gDWYfjr2FhSLTHUunQ5cBFmW82PR1vd5/view?usp%3Dsharing",null,null,null,1],null,null,1,null,null,"https://docs.google.com",null,1,[null,0],["https://youtube.googleapis.com",null,2],1,null,null,null,1,null,1,1,null,null,null,null,[1,1,1,1],null,1,null,3,null,null,null,null,1,["AIzaSyCMp6sr4oTC18AWkE2Ii4UBZHTHEpGZWZM","https://blobcomments-pa.clients6.google.com",null,1,1,1,null,null,null,null,"ANONYMOUS_17612595759507348808"],null,1,null,null,0,null,null,1,null,null,null,[1,1,1],null,null,1,1,[null,null,"https://clients6.google.com","AIzaSyD_InbmSFufIEps5UAt2NmB_3LvBH3Sz_8","https://people-pa.googleapis.com",null,null,1,1,1,1],null,1,null,null,null,null,[0,0],null,null,null,null,0,null,0,1,null,null,null,null,null,null,[0,"","","",""],1,[null,null,0,0,0,0,1],null,1,[[null,null,null,"//drive.google.com/odp/embed"],null,"","AIzaSyCIGHYEdm91p31HKyJSoU4at7IqhCViXuA",1,null,[null,null,null,"//drive.google.com/odp/dialog"]],[1],null,null,null,null,1,"https://workspace.google.com",null,null,1,1,1,1,1,null,1,["AIzaSyCMp6sr4oTC18AWkE2Ii4UBZHTHEpGZWZM","https://drivemetadata.clients6.google.com"],0,1,1], itemJson: [null,"URL_List.txt","https://lh5.googleusercontent.com/fj9qJmqhNlMRAfkcUuBs0WZz2fMg5Mvuw9yQu8k75XLETScB2kVe8YEWPFewfF6Xi4kME9XUFwQZoQ\u003dw1600",null,null,null,null,null,null,"https://drive.google.com/viewerng/upload?ds\u003dAPznzaYdfa24fByFIZg3fiKWc8CSgJHZqTiK1CmXJ9rVoufvL2ZVY-c77RFjr0QfWH_8gXZ_3If1-BPOJC2MfrU2lobk9OMLJwckmaAtrFK_dFGEbOL7Xx_tHgs0CqxLbyAMnUfNms9lFfZAIhf9Mn9HJKhpSRjdSqWPjC4WItasfIIKE_5lQKM8lYajOJ8KQVNUvlM4N9Sj1muKZFPvtDJ7tkjNpv7zx5TwpUQj7xYKTFFm-RRal3LfLbGoD28UfBfDYx1aXLI2K6A2eRdBrVZswur9JwDTO8IIwBENy9RYKkdGgZl4wNR2PcriVj45SKOM2g4_gHRmTAYJMDOSwYPP0LpgiBTQX64fAXOhyWqPNLl0gYuVGWE%3D\u0026ck\u003ddrive\u0026p\u003dproj",null,"text/plain",null,null,6,null,"https://drive.google.com/file/d/1gDWYfjr2FhSLTHUunQ5cBFmW82PR1vd5/view",null,"https://drive.google.com/uc?id\u003d1gDWYfjr2FhSLTHUunQ5cBFmW82PR1vd5\u0026export\u003ddownload",null,5,0,null,null,null,[null,null,"101"],null,null,null,null,null,0,"txt",null,[["0B6td48lYowV-WGlDVUtiREtlYjBoNjN5b3pzeVR2U09kbHBJPQ"],[],["1gDWYfjr2FhSLTHUunQ5cBFmW82PR1vd5"]],null,null,null,null,null,null,0,null,0]};</script><script nonce="i7nJhbgQY3EllroO23kuQg">;this.gbar_={CONFIG:[[[0,"www.gstatic.com","og.qtm.en_US.XzJ0ONUNIso.O","com","en","25",0,[4,2,"","","","444135851","0"],null,"rqdrYsWIH5SfqtsPw_KygAo",null,0,"og.qtm.L8VIEKh59Qg.L.X.O","AA2YrTuxcq54HDP2gjPFC5ABnSWGsNBFIw","AA2YrTujoajh5TPNaG7eZGyhbqpOr6S54A","",2,1,200,"USA",null,null,"25","25",1],null,[1,0.1000000014901161,2,1],[1,0.001000000047497451,1],[0,0,0,null,"","","",""],[0,0,"",1,0,0,0,0,0,0,null,0,0,null,0,0,null,null,0,0,0,"","","","","","",null,0,0,0,0,0,null,null,null,"rgba(32,33,36,1)","rgba(255,255,255,1)",0,0,0,null,null,1,0,0],null,null,["1","gci_91f30755d6a6b787dcc2a4062e6e9824.js","googleapis.client:gapi.iframes","","en"],null,null,null,null,["m;/_/scs/abc-static/_/js/k=gapi.gapi.en.Yozr9QYVVr4.O/d=1/rs=AHpOoo8ePFN_mLj5L9BxNRnarRImlQEt0w/m=__features__","https://apis.google.com","","","","",null,1,"es_plusone_gc_20220321.0_p0","en",null,0],[0.009999999776482582,"com","25",[null,"","0",null,1,5184000,null,null,"",null,null,null,null,null,0,null,0,0,1,0,0,0,null,null,0,0,null,0,0,0,0,0],null,null,null,0,null,null,["5061451","google\\.(com|ru|ca|by|kz|com\\.mx|com\\.tr)$",1]],[1,1,null,28834,25,"USA","en","444135851.0",8,0.009999999776482582,0,0,null,null,null,null,"3700949",null,null,null,"rqdrYsWIH5SfqtsPw_KygAo",0,0,0,null,2,5,"rw",6],[[null,null,null,"https://www.gstatic.com/og/_/js/k=og.qtm.en_US.XzJ0ONUNIso.O/rt=j/m=qabr,q_dnp,qapid/exm=qaaw,qadd,qaid,qein,qhaw,qhbr,qhch,qhga,qhid,qhin,qhpr/d=1/ed=1/rs=AA2YrTuxcq54HDP2gjPFC5ABnSWGsNBFIw"]]]],};this.gbar_=this.gbar_||{};(function(_){var window=this;
URL to Tsv file must be publicly available. Looks like transfer service got HTML response with access error rather than the content of the TSV file.
The problem was that when you provide the URL to the, it must be to the link which allows you to download the file. You need to modify the URL for this. You can do this as shown below:
https://drive.google.com/open?id=FILE_ID
The FILE_ID is unique for every file in Google Drive. Then you’ll get a direct link to download the file from Google Drive

VSCode cross-origin request inside WebView

I'm working on extension which based on VSCode WebView. Extension make integration with issue tracking system over HTTP API, like Jira. I want to render information about issue in WebView and create some forms for making comments and changing issue status. I don't want to use message passing between extension and WebView. When I try to create HTTP request to API inside WebView I got error:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Server does't support Access-Control-Allow-Origin for "null" or "localhost" Origin.
Is the way to create HTTP request from WebView to server ignoring missing Access-Control-Allow-Origin header? Maybe I can setup some policy for WebView panel? Or create localhost proxy inside extension and make request over proxy?
Code example
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
vscode.commands.registerCommand('catCoding.start', () => {
// Create and show panel
const panel = vscode.window.createWebviewPanel(
'catCoding',
'Cat Coding',
vscode.ViewColumn.One,
{enableScripts: true}
);
// And set its HTML content
panel.webview.html = getWebviewContent();
})
}
function getWebviewContent() {
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cat Coding</title>
</head>
<body>
<script>
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://google.com', true);
xhr.send();
</script>
</body>
</html>`;
}
Answer from Github Issue
There is no vscode support for changing this. You should think of the webview more as an html view (one that does not have any server or origin) rather than a webpage
Posters on stackoverflow may have suggestions for workarounds
Support for Cross Origin Isolation was just added for Webview through the use of the vscode-coi url parameter; see https://github.com/microsoft/vscode/issues/137884

Return to my app after launching safari

I use this code to launch safari and post a message for the client:
NSURL *url = [NSURL URLWithString:#"http://www.Mysite.com/testok.html"];
[[UIApplication sharedApplication] openURL: url];
What I want to do is that after a few seconds from launching safari it would automatically close and return back to my app.
You can register your application for a custom URL scheme and call that via Java Script from your web site. For more information on URL schemes take a look at the iOS App Programming Guide.
Maybe a better solution would be to embed your web page into your app using an UIWebView.
Use the Following Steps. URLScheme is Best Solution. I hope it is working for you.
In iPhone Info.plist make URLSchemas Like below Link
Client Side (iPhone Project) Setting
Add the following Html Code to Redirect Button in Safari browser.
<html><head>
<script type="text/javascript">
function redirection() {
var userAgent = window.navigator.userAgent;
if (userAgent.match(/iPad/i) || userAgent.match(/iPhone/i)) {
window.location = "myapp://" // This is your app name. make sure it's like URLScheme Name
}
}
</script>
</head>
<body>
Some html page
<input type="button" value="back" onclick="redirection()"/>
</body>
</html>

Connect to Facebook with Javascript Client Library using Adobe AIR

I'm having an issue connecting to Facebook through the Javascript Client Library in Adobe AIR. It works fine in the browser but in Adobe AIR it seems to not be able to find the Facebook functions. Here is some code I copied from the Facebook website: (Oh and I have the xd_receiver.htm file in the correct path too)
<textarea style="width: 1000px; height: 300px;" id="_traceTextBox">
</textarea>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
//
var api = FB.Facebook.apiClient;
// require user to login
api.requireLogin(function(exception){
FB.FBDebug.logLevel=1;
FB.FBDebug.dump("Current user id is " + api.get_session().uid);
// Get friends list
//5-14-09: this code below is broken, correct code follows
//api.friends_get(null, function(result){
// Debug.dump(result, 'friendsResult from non-batch execution ');
// });
api.friends_get(new Array(), function(result, exception){
FB.FBDebug.dump(result, 'friendsResult from non-batch execution ');
});
});
});
//]]>
</script>
It's not that simple actually man, the problem with loading external script files from the application sandbox is that it's not supported. Technically, by using iframes, you should be able to do this and it works but it's still impossible to use XFBML in the root document after from my experience. After two days of trial and error, the easiest way to do use Facebook Connect in an html/ajax adobe air application is to download the actionscript library and include it as such:
<script type="application/x-shockwave-flash" src="lib/facebook.swf"></script>
<script type="text/javascript">
var FB = window.runtime.com.facebook;
var fb = new FB.Facebook();
var session = new FB.utils.DesktopSessionHelper();
//etc...
</script>
then just refer to the documentation. my only problem now it that I still haven't found an efficient enough way of using XFBML in adobe air, simply adding the facebook namespace to the html tag doesn't do the trick unfortunately. If any knows, please do share thanks
you also need to change xml namespace (main html tag) to this:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en-gb" lang="en-gb">