corona iOS and Android error while building - facebook

all at once today I could not build app neither iOS nor Android. I developed by using Corona Sdk 2014.2511. For both platform I get "Runtime Error":
iOS:
module Facebook not found: resource (facebook.lu) does not exist in archive
no field package.preload["Facebook"]
no file "/private/var/mobile/Containers/Bundle/Application/...and so on
Android
/Users/jenkins/slaveroot/workspace/label/android/platform/resources/init.lua:820module "Facebook" not found. resource (Facebook.lu) does not exist in archive
no field package preload...etc
Apparently bot errors depend on Module Facebook! I really don't know what to do. Just followed suggestions from the web and modified file build.settings as follows:
settings =
{
orientation =
{
-- Supported values for orientation:
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
default = "portrait",
supported = { "portrait", }
},
excludeFiles =
{
-- Include only the necessary icon files on each platform
iphone = { "Icon-*dpi.png", },
android = { "Icon.png", "Icon-Small-*.png", "Icon*#2x.png", },
},
plugins =
{
["CoronaProvider.native.popup.social"] =
{
publisherId = "com.coronalabs"
},
},
{
["facebook"] =
{
publisherId = "com.coronalabs"
},
},
--
-- iOS Section
--
iphone =
{
plist =
{
UIStatusBarHidden = false,
UIPrerenderedIcon = true, -- set to false for "shine" overlay
--UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend
UIAppFonts = { "RepriseStamp.ttf", "REPRISESTAMP.dfont"},
CFBundleIconFiles =
{
"Icon.png",
"Icon#2x.png",
"Icon-60.png",
"Icon-60#2x.png",
"Icon-60#3x.png",
"Icon-72.png",
"Icon-72#2x.png",
"Icon-76.png",
"Icon-76#2x.png",
"Icon-Small.png",
"Icon-Small#2x.png",
"Icon-Small#3x.png",
"Icon-Small-40.png",
"Icon-Small-40#2x.png",
"Icon-Small-50.png",
"Icon-Small-50#2x.png",
},
{
UIApplicationExitsOnSuspend = false,
FacebookAppID = "5XXXXXXXXXX", --replace XXXXXXXXXX with your Facebook App ID
CFBundleURLTypes =
{
{ CFBundleURLSchemes = { "fb5XXXXXXXXXX", } } --replace XXXXXXXXXX with your Facebook App ID
},
["URL types"] =
{
item =
{
["URL Schemes"] = { ["Item 0"] = "fb5XXXXXXXXXX" }, --replace XXXXXXXXXX with your Facebook App ID
},
},
}
}
},
--
-- Android Section
--
android =
{
usesPermissions =
{
"android.permission.INTERNET",
},
},
}
Unfortunately nothing changed. I have been getting always the same errors. Any help? thanks a lot! Ubaldo

You have an error in your build.settings.
plugins =
{
["CoronaProvider.native.popup.social"] =
{
publisherId = "com.coronalabs"
},
["facebook"] =
{
publisherId = "com.coronalabs"
},
},

Related

'dartls -32007 file is not being analyzed' error whenever I open a file in Neovim

I am new to Neoviim. So, I am currently using Astronvim and I have setup flutter-tools plugin by following the guide here.
Whenever I open a dart file I get the following error: dartls -32007 file is not being analyzed
Autocompletion and Fluttter commands works, but some feature like color highlights and goto definitions stops working in a dart file sometimes.
My config look like this:
return {
lsp = {
skip_setup = { "dartls" }, -- skip lsp setup because flutter-tools will do it itself
["server-settings"] = {
dartls = {
-- any changes you want to make to the LSP setup, for example
color = {
enabled = true,
},
settings = {
showTodos = true,
completeFunctionCalls = true,
},
},
},
},
plugins = {
init = {
{
"akinsho/flutter-tools.nvim",
requires = "nvim-lua/plenary.nvim",
after = "mason-lspconfig.nvim", -- make sure to load after mason-lspconfig
config = function()
require("flutter-tools").setup {
lsp = astronvim.lsp.server_settings "dartls", -- get the server settings and built in capabilities/on_attach
}
end,
},
},
},
}

Vscode language server extension connection.onCompletion

I am creating a language server. Specifically, the issue is with completions. I'm returning a big list of completion items but whenever I test my language the completion provider simply will not suggest anything after I type a dot(.) when I'm expecting it to suggest, essentially, class members associated with the symbol left of said dot(.). Don't get me wrong, suggestions work until I type the dot(.) character and then it says, "No Suggestions".
Also, I'm trying to implement this server side and not client side.
EDIT:
Essentially, I'm assembling a big list and returning it.
connection.onInitialize((params: node.InitializeParams) => {
workspaceFolder = params.workspaceFolders![0].uri;
const capabilities = params.capabilities;
// Does the client support the `workspace/configuration` request?
// If not, we fall back using global settings.
hasConfigurationCapability = !!(
capabilities.workspace && !!capabilities.workspace.configuration
);
hasWorkspaceFolderCapability = !!(
capabilities.workspace && !!capabilities.workspace.workspaceFolders
);
hasDiagnosticRelatedInformationCapability = !!(
capabilities.textDocument &&
capabilities.textDocument.publishDiagnostics &&
capabilities.textDocument.publishDiagnostics.relatedInformation
);
capabilities.workspace!.workspaceEdit!.documentChanges = true;
const result: node.InitializeResult = {
capabilities: {
textDocumentSync: node.TextDocumentSyncKind.Incremental,
colorProvider: true,
hoverProvider: true,
definitionProvider: true,
typeDefinitionProvider: true,
referencesProvider: true,
documentHighlightProvider: true,
documentSymbolProvider: true,
workspaceSymbolProvider: true,
// codeActionProvider: true,
codeLensProvider: {
resolveProvider: true,
workDoneProgress: false
},
// Tell the client that this server supports code completion.
completionProvider: {
resolveProvider: true,
workDoneProgress: false,
triggerCharacters: ['.', '/'],
allCommitCharacters: ['.']
},
signatureHelpProvider: {
triggerCharacters: ['('],
retriggerCharacters: [','],
workDoneProgress: false
},
executeCommandProvider: {
commands: ["compile"],
workDoneProgress: false
},
semanticTokensProvider: {
documentSelector: [{ scheme: 'file', language: 'agc' }],
legend: {
tokenTypes: gTokenTypes,
tokenModifiers: gTokenModifiers
},
full: true,
workDoneProgress: false
}
}
};
if (hasWorkspaceFolderCapability) {
result.capabilities.workspace = {
workspaceFolders: {
supported: true
}
};
}
return result;
});
// This handler provides the initial list of the completion items.
connection.onCompletion(
async (params: node.TextDocumentPositionParams): Promise<node.CompletionItem[] | node.CompletionList | undefined> => {
console.log("completion");
let doc = documents.get(params.textDocument.uri);
let list:node.CompletionList = node.CompletionList.create([], true);
list.items = list.items.concat(comp.GetAGKKeywordCompletionItems(), comp.GetAGKCommandCompletionItems(), agkDocs.getALLCompletionItems());
list.items.push(sense.GetCommentSnippetCompletionItem(doc, params.position));
list.items.push(sense.GetCommentSnippetCompletionItem(doc, params.position, true));
console.log("END completion");
return list;
}
);

Mongoose select,populate and save behaving differently on Mac and Windows

Here's what i did
static populateReferralLinks(){
return Promise.coroutine(function*(){
let companies = yield Company.find({},'billing referral current_referral_program')
.populate('billing.user','emails name');
for(let i = 0 ; i < length ; i++){
companies[i].referral.is_created = true;
companies[i].referral.referral_email = companies[i].billing.user.emails[0].email;
companies[i] = yield companies[i].save();
}
return companies;
}).apply(this)
.catch((err) => {
throw err;
});
}
I have a funciton in which i am selecting only 3 fields to go ahead with i.e billing,current_referral_program and referral.
And populating user using the reference stored in billing.user.
Now when i call this function then on line
companies[i].save();
The following command is shown in the terminal in windows
Mongoose: companies.update(
{ _id: ObjectId("58d12e1a588a96311075c45c") },
{ '$set':
{ billing:
{ configured: false,
user: ObjectId("58d12e16588a96311075c45a") },
referral:
{ is_created: true,
referral_email: 'jadon.devesh98#gmail.com',
},
updatedAt: new Date("Wed, 22 Mar 2017 12:02:55 GMT")
}
}
)
But in Mac's terminal it shows this command
Mongoose: companies.update({ _id: ObjectId("58d12e1a588a96311075c45c") }) { '$set': { billing: { configured: false, user: ObjectId("58d12e16588a96311075c45a") }, current_limit: {}, current_usage: {},referral: { is_created: true, referral_email: 'jadon.devesh98#gmail.com'}}, '$unset': { updatedAt: 1 } }
Now, I haven't mentioned current_limit and current_usage to be empty. it's executing fine on windows but on Mac it's setting current_limit and current_usage empty thus updating my document with empty objects on Mac but not on windows.
It should behave same way on both OS but it is not.
Apparently this problem was there in Mongoose 4.5.8 and is resolved in the latest version i.e 4.9.1
Check it here

Google Cloud Print from Web

I wrote a script that prints some test pages from url on Web-site,
and every time I press a print button, a dialog frame for choosing printer appears . But I want to avoid this because my account synchronized with printer.
window.onload = function() {
var gadget = new cloudprint.Gadget();
gadget.setPrintButton(
cloudprint.Gadget.createDefaultPrintButton("print_button_container")); // div id to contain the button
gadget.setPrintDocument("url", "Test Page", "https://www.google.com/landing/cloudprint/testpage.pdf");
}
You could use oath and an html button rather than a gadget to accomplish this. This requires using the google developer console to get oauth permissions.
Then you need to authorize the cloud print service.
The following set of functions are specifically good for use in Google Apps Scripts, but can be adapted. The first thing to do is Log a url link that you can go to in order to Authorize the cloud print service.
function showURL() {
var cpService = getCloudPrintService();
if (!cpService.hasAccess()) {
Logger.log(cpService.getAuthorizationUrl());
}
}
In the following component of this set of functions, make sure to replace the client Id and Secret.
function getCloudPrintService() {
return OAuth2.createService('print')
.setAuthorizationBaseUrl('https://accounts.google.com/o/oauth2/auth')
.setTokenUrl('https://accounts.google.com/o/oauth2/token')
.setClientId('**YOUR CLIENT ID FROM GOOGLE DEVELOPER CONSOLE**')
.setClientSecret('**YOUR CLIENT SECRET**')
.setCallbackFunction('authCallback')
.setPropertyStore(PropertiesService.getUserProperties())
.setScope('https://www.googleapis.com/auth/cloudprint')
.setParam('login_hint', Session.getActiveUser().getEmail())
.setParam('access_type', 'offline')
.setParam('approval_prompt', 'force');
}
function authCallback(request) {
var isAuthorized = getCloudPrintService().handleCallback(request);
if (isAuthorized) {
return HtmlService.createHtmlOutput('You can now use Google Cloud Print from Apps Script.');
} else {
return HtmlService.createHtmlOutput('Cloud Print Error: Access Denied');
}
}
Next, get the ID of the Cloud Print Printer that you want to use. This can be obtained in the settings menu of Chrome. Settings --> Show Advanced Settings --> Under Cloud Print " Manage" --> Select the Printer that you want to use "Manage" -->Advanced Details
To initiate cloud print, you need to add the details to a ticket:
var ticket = {
version: "1.0",
print: {
color: {
type: "STANDARD_COLOR",
vendor_id: "Color"
},
duplex: {
type: "LONG_EDGE"
},
copies: {copies: 1},
media_size: {
width_microns: 215900,
height_microns:279400
},
page_orientation: {
type: "PORTRAIT"
},
margins: {
top_microns:0,
bottom_microns:0,
left_microns:0,
right_microns:0
},
page_range: {
interval:
[{start:1,
end:????}]
}
}
};
There are many options that you can add to the ticket. See documentation
Finally, you need to initiate the Cloud Print Service. Here is where you get to define the specific printer that you want.
var payload = {
"printerid" : '**COPY YOUR PRINTER ID HERE**',
"title" : "Prep Print",
"content" : PUT YOUR CONTENT HERE...(e.g. If you do all of this using Google Apps Script...HtmlService.createHtmlOutput(VARIABLE).getAs('application/pdf')),
"contentType": 'text/html',
"ticket" : JSON.stringify(ticket)
};
var response = UrlFetchApp.fetch('https://www.google.com/cloudprint/submit', {
method: "POST",
payload: payload,
headers: {
Authorization: 'Bearer ' + getCloudPrintService().getAccessToken()
},
"muteHttpExceptions": true
});
response = JSON.parse(response);
if (response.success) {
Logger.log("%s", response.message);
} else {
Logger.log("Error Code: %s %s", response.errorCode, response.message);}
var outcome = response.message;
}

Blank page after login on iOS

I'm using the iOS Facebook SDK, and have an app that uses the following code to post on a user's wall:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"Share on Facebook",
#"user_message_prompt",
shareUrl, #"link",
imgUrl, #"picture",
nil];
[_facebook dialog:#"feed" andParams:params andDelegate:self];
as adapted from the example that comes with the SDK.
It used to work fine, very recently, it has started to break - you log in, then you're just presented with a blank page (with the facebook logo + blue stripe at the top).
The link the webView is pointing to is
http://m.facebook.com/#!/dialog/feed?_path=feed&app_id=177538815636301&redirect_uri=fbconnect%3A%2F%2Fsuccess&sdk=2&display=touch&link=http%3A%2F%2Fxxxxx.xxxxx.com%2F%3Fcode%3D3dh574&picture=http%3A%2F%2Fxxxx.xxxxx.com%2Ffiles%2F3dh574.png&user_message_prompt=Share%20on%20Facebook&from_login=1&__user=100002342336489
If I open this link in my browser on my mac, it shows the correct page, but on the iPhone it's just a blank screen. No errors in the console or on the page itself.
I managed to get the webView contents, it looks like this:
window._sync_cstart = +new Date;
Facebook Mobilewindow.FB_GKS = {
"moulder_feed": 1,
"moulder_feed_hide_toggle": 0,
"timeline_mobile": 0,
"groups_faceweb": 0,
"mobile_js_show_errorbox": 0,
"mobile_js_show_debug": false
};
window.m_version = "M_siWj64";
document.cookie = "m_version=M_siWj64; path=\/"; /*<![CDATA[*/
function si_cj(m) {
setTimeout(function () {
new Image().src = "http:\/\/error.facebook.com\/common\/scribe_endpoint.php?c=si_clickjacking&t=3135" + "&m=" + m;
}, 5000);
}
if (top != self && !false) {
try {
if (parent != top) {
throw 1;
}
var si_cj_d = ["apps.facebook.com", "\/pages\/", "apps.beta.facebook.com"];
var href = top.location.href.toLowerCase();
for (var i = 0; i < si_cj_d.length; i++) {
if (href.indexOf(si_cj_d[i]) >= 0) {
throw 1;
}
}
si_cj("3 http:\/\/m.facebook.com\/login.php?app_id=177538815636301&sdk=2&cancel=fbconnect\u00253A\u00252F\u00252Fsuccess&next=https\u00253A\u00252F\u00252Fm.facebook.com\u00252Fdialog\u00252Ffeed\u00253F_path\u00253Dfeed\u002526app_id\u00253D177538815636301\u002526redirect_uri\u00253Dfbconnect\u0025253A\u0025252F\u0025252Fsuccess\u002526sdk\u00253D2\u002526display\u00253Dtouch\u002526link\u00253Dhttp\u0025253A\u0025252F\u0025252Frefract.swarovski.com\u0025252F\u0025253Fcode\u0025253D3dh574\u002526picture\u00253Dhttp\u0025253A\u0025252F\u0025252Frefract.swarovski.com\u0025252Ffiles\u0025252F3dh574.png\u002526user_message_prompt\u00253DShare\u00252Bon\u00252BFacebook\u002526from_login\u00253D1&rcount=1&_rdr");
} catch (e) {
si_cj("1 \thttp:\/\/m.facebook.com\/login.php?app_id=177538815636301&sdk=2&cancel=fbconnect\u00253A\u00252F\u00252Fsuccess&next=https\u00253A\u00252F\u00252Fm.facebook.com\u00252Fdialog\u00252Ffeed\u00253F_path\u00253Dfeed\u002526app_id\u00253D177538815636301\u002526redirect_uri\u00253Dfbconnect\u0025253A\u0025252F\u0025252Fsuccess\u002526sdk\u00253D2\u002526display\u00253Dtouch\u002526link\u00253Dhttp\u0025253A\u0025252F\u0025252Frefract.swarovski.com\u0025252F\u0025253Fcode\u0025253D3dh574\u002526picture\u00253Dhttp\u0025253A\u0025252F\u0025252Frefract.swarovski.com\u0025252Ffiles\u0025252F3dh574.png\u002526user_message_prompt\u00253DShare\u00252Bon\u00252BFacebook\u002526from_login\u00253D1&rcount=1&_rdr");
window.document.write("\u003cstyle>body * {display:none !important;}\u003c\/style>\u003ca href=\"#\" onclick=\"top.location.href=window.location.href\" style=\"display:block !important;padding:10px\">Go to Facebook.com\u003c\/a>"); /*B145Ecbc*/
}
} /*]]>*/
Loading...Loading...MExceptionHandler.run(function () {
JX.Stratcom.mergeData(0, {});
MExceptionHandler.run(function () {
JX.initBehaviors({
"m-response": [],
"m-page-error": [{
"mobile_js_show_errorbox": 0,
"mobile_js_show_debug": false
}],
"m-link": [],
"ios-webapp": [],
"m-verify-cache": [{
"viewer": 100002342336489
}],
"usercheck": [{
"user_id": 100002342336489
}],
"dtsg": [{
"dtsg": {
"token": "AQB2zmo7",
"expire": 1318070716
}
}],
"m-scroll-position-saver": [],
"m-ajax-loader": [{
"future": false
}],
"m-back-button": [],
"m-blocking-touchable": []
})
}, "behavior");
}, "onload");
fbDidNotLogin callback is not called. No errors appear - I've put a lot of NSLog()'s in, pretty much in every method.
Any ideas?