iOS Deprecated API Usage Warning Ionic using UIWebView

Apple will no longer support web apps that use UIWebView. The apps and libraries need to be migrated to use WkWebView.

The latest Ionic already uses WkWebView, but several Cordova plugins still rely on UIWebView which is a problem.

https://ionicframework.com/docs/v3/wkwebview/

If you’re using Ionic you need to upgrade to iOS Cordova 5

cordova platform remove ios
cordova platform add ios@5.0.0

Also you might need to remove additional plugins that use UIWebView such as inappbrowser.

cordova plugin rm cordova-plugin-inappbrowser

More information about the breaking changes can be found here:

https://cordova.apache.org/news/2018/08/01/future-cordova-ios-webview.html

Raspberry PI used to hack NASA Secrets

Engadget reporting:

NASA’s Jet Propulsion Laboratory (JPL) suffers from multiple cybersecurity weaknesses despite the advances it has achieved in space technology, according to the agency’s Office of Inspector General (PDF). Investigators looked into the research center’s network security controls after an April 2018 security breach, wherein a Raspberry Pi that was not authorized to be linked to the JPL network was targeted by hackers. The attackers were able to steal 500 megabytes of data from one of its major mission systems, and they also used that chance to find a gateway that allowed them to go deeper into JPL’s network.

Probably happens all the time.

All The Things Game of Thrones Left Hanging in the Air

The Verge has the full list:

A few of my favorites:

Where did the Dothraki go?

Unclear. There’s a clear shot of some Dothraki just chilling by the docks in King’s Landing while Jon makes his sad walk to his boat, but while there’s some clear information about why the Unsullied didn’t riot, kill Jon Snow, and take the city themselves, the same courtesy isn’t given the Dothraki, who were apparently pretty chill about their queen being murdered.

Given that they only came to Westeros to serve Dany and help her kill the men in metal suits and break their stone houses, it’s not clear what they have to do now, especially with their Khaleesi dead. Still, for a Dothraki fighter, the whole Westeros trip was probably a pretty successful vacation, given those goals.

What about the Unsullied?

While Tyrion does offer them land in the Reach and the chance to become a house of Westeros, we see Grey Worm captaining a ship of Unsullied later in the episode, alongside a fleet of similarly black-sailed ships. It’s not entirely clear whether the entire band of Unsullied is joining Grey Worm as he sails to Naath, presumably to liberate Missandei’s people. But it does seem likely that they’re going collectively.

It seems that with or without Daenerys to lead them, the Unsullied will continue to fight to liberate people — a fitting ending for the freed slaves.

Why does the North just get to stay independent?

It’s a little strange that Sansa casually breaks the North away from the rest of the Seven (now Six) Kingdoms in accordance with the North’s well-established independent streak, and the lords of the Vale, the Riverlands, Casterly Rock, Storm’s End, the Reach, and Dorne don’t have the faintest word to say about their own status.

Honestly, there’s no real reason why the North should get its independence — especially since, say, Dorne is a far more independent kingdom, which joined the Seven Kingdoms two centuries after Aegon conquered the others. Dorne has historically been far more independently minded than the North, even though the North’s rebellion against the Iron Throne got a lot more air time on the show.

What’s Daario up to?

Daario Naharis was part of the Mereen subplot on the show. He eventually led the Second Sons, a mercenary company, and was one of Daenerys’ paramours, as well as part of her inner circle when she led the city. But when Daenerys leaves for Westeros at the end of the sixth season, she leaves Daario behind in Meereen alongside the Second Sons, and we haven’t seen him since.

Given his importance to Daenerys and the large military force he commands, it’s possible that the show could have brought him back for the war against Cersei, but it seems like Daario is still stuck in Mereen.

A Retro Adventure Game Creator for Your Favorite Handheld Video Game System

John Gruber via Daring Fireball:

GB Studio is “A free and easy to use retro adventure game creator for your favourite handheld video game system”, by which they mean, but don’t want to name specifically, Nintendo’s GameBoy.

What a fun idea from developer Chris Maltby. You can output ROMs for emulators, play them on actual GameBoy hardware with a flash cartridge, or even export them for the web (which will even work on phones). It’s a remarkably polished IDE.

Get it here.

How to Use iOS GameCenter Leaderboards in Unity3d

You need to setup your app on the appstore connect first with the appropriate leaderboard. And you can only test this code on the iOS device and not in the unity3d player.


using UnityEngine.SocialPlatforms;

  private ILeaderboard leaderboard;
  private string leaderboard_id = "yourleaderboardid"; // setup on appstore connect

 void Start()
 {

    // Authenticate user first
        Social.localUser.Authenticate(success => {
            if (success)
            {
                Debug.Log("Authentication successful");
                string userInfo = "Username: " + Social.localUser.userName +
                    "\nUser ID: " + Social.localUser.id +
                    "\nIsUnderage: " + Social.localUser.underage;
                Debug.Log(userInfo);
            }
            else
                Debug.Log("Authentication failed");
        });

  // create social leaderboard
        leaderboard  = Social.CreateLeaderboard();
        leaderboard.id = leaderboard_id;
        leaderboard.LoadScores(result =>
        {
            Debug.Log("Received " + leaderboard.scores.Length + " scores");
            foreach (IScore score in leaderboard.scores)
                Debug.Log(score);
        });
  }

  void ReportScore(long score, string leaderboardID)
  {
        Debug.Log("Reporting score " + score + " on leaderboard " + leaderboardID);
        Social.ReportScore(score, leaderboardID, success => {
            Debug.Log(success ? "Reported score successfully" : "Failed to report score");
        });
  }

 void OpenLeaderboard()
 {
        Social.ShowLeaderboardUI();
 }

What is SoftBank, and who is behind the Silicon Valley’s largest VC fund?

Recode:

SoftBank is a Tokyo-based company founded almost four decades ago by Masayoshi Son at the age of 24. What started as a store for computer parts has become one of Japan’s most important public companies, valued at over $115 billion. It now is essentially a tech, media, and telecom conglomerate — it owns more than 80 percent of Sprint, more than one-quarter of Alibaba, and 100 percent of the robotics company Boston Dynamics, whose nightmare-inducing animatronics might be familiar to you.

But SoftBank in recent years has been transitioning from a Verizon or AT&T of Japan to something like more of a Blackstone of the world, intentionally moving from a telecom-based giant to a global investing vehicle — thanks, largely, to the Vision Fund.

To understand SoftBank is to understand Son, an eccentric, Star Wars-quoting, diminutive man who is known in the world of high finance solely as “Masa.” To his fans, Son is a daring savant, whose early investment in Alibaba has become part of venture capital lore and at one point made him one of the richest men in the world. To his detractors, Son is an arrogant fool who got lucky once but has since run roughshod over a venture capital system that was already working.

Scary & interesting read.

Uber Stock is a Disaster

Gizmodo reporting:

According to one analyst, the company may be profitable by 2024, though its only real plan so far is to continue to screw workers and eventually replace them with unproven technology. As former CEO Travis Kalanick said in 2014, “the reason that Uber could be expensive is you’re not just paying for the car, you’re paying for the other dude in the car who’s driving.”

Presently, investors are probably realizing that what they’re paying for is an unsustainable company so huge that its main justification for existing is sunk cost.

Ouch.

How to Create Looping Sound with Amazon Alexa Skill App

An example how to play audio with AWS Lambda function for your Amazon Alexa Skill:

The way to do this is to append the same mp3 file to the play queue once the current file is “nearly finished” playing.


const Alexa = require('ask-sdk-core');

const soundURL = 'https://urltosomefile.mp3';
let expectedPreviousToken = '';

const LaunchRequestHandler = {
	canHandle(handlerInput) {
	  return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
	},
	handle(handlerInput) {

	expectedPreviousToken = 'sometoken' + Math.random();
	return handlerInput.responseBuilder
	 .speak('start playing sound')
	 .addAudioPlayerPlayDirective('REPLACE_ALL', soundURL, expectedPreviousToken, 0, null)
	 .withSimpleCard('Example', 'Example')
	 .getResponse();
	}
};

const StartSoundHandler = {
	canHandle(handlerInput) {
		return handlerInput.requestEnvelope.request.type === 'IntentRequest'
		&& handlerInput.requestEnvelope.request.intent.name === 'StartSoundHandler';
	},
	handle(handlerInput) {

	 expectedPreviousToken = 'sometoken'+Math.random();
	 return handlerInput.responseBuilder

	 .addAudioPlayerPlayDirective
              ('REPLACE_ALL', soundURL, expectedPreviousToken, 0, null)
	 .withSimpleCard('Example', 'Example')
	 .getResponse();
	}
};


const ExitHandler = {
	canHandle(handlerInput) {
	const request = handlerInput.requestEnvelope.request;

	return request.type === 'IntentRequest' &&
		(request.intent.name === 'AMAZON.StopIntent' ||
		request.intent.name === 'AMAZON.CancelIntent');
	},
	handle(handlerInput) {
		return handlerInput.responseBuilder
		.addAudioPlayerStopDirective()
		.getResponse();
	}
};

const SessionEndedRequestHandler = {
	canHandle(handlerInput) {
		return handlerInput.requestEnvelope.request.type === 'SessionEndedRequest';
	},
	handle(handlerInput) {
		//any cleanup logic goes here
		return handlerInput.responseBuilder.getResponse();
	}
};

const PausePlaybackHandler = {
	canHandle(handlerInput) {

	const request = handlerInput.requestEnvelope.request;

	return request.type === 'IntentRequest' &&
		request.intent.name === 'AMAZON.PauseIntent';
	},
	handle(handlerInput) {
		return handlerInput.responseBuilder
			.speak('Sound is paused.')
			.addAudioPlayerStopDirective()
			.withSimpleCard('Example', 'Bye!')
			.getResponse();
	},
};


const AudioPlayerEventHandler = {
	canHandle(handlerInput) {
		const request = handlerInput.requestEnvelope.request;

		return request.type === 'AudioPlayer.PlaybackStarted' ||
			request.type === 'AudioPlayer.PlaybackStopped' ||
			request.type === 'AudioPlayer.PlaybackNearlyFinished' ||
			request.type === 'AudioPlayer.PlaybackFailed';
	},
	handle(handlerInput) {
		const request = handlerInput.requestEnvelope.request;

		switch (request.type) {

		 case 'AudioPlayer.PlaybackStarted':
		   expectedPreviousToken = request.token;
		   return handlerInput.responseBuilder
		     .getResponse();

		 case 'AudioPlayer.PlaybackFinished':
		  return handlerInput.responseBuilder
		  .getResponse();

		 case 'AudioPlayer.PlaybackStopped':
			 return handlerInput.responseBuilder
			 .getResponse();

		 case 'AudioPlayer.PlaybackNearlyFinished':

		   return handlerInput.responseBuilder
		      .addAudioPlayerPlayDirective
                       ('ENQUEUE', soundURL, 'sometoken', 0, expectedPreviousToken)
		       .getResponse();

		 case 'AudioPlayer.PlaybackFailed':
			 console.log('Playback Failed');
			 break;
		}

		return handlerInput.responseBuilder.getResponse();
	},
};

const ErrorHandler = {
	canHandle() {
		return true;
	},
	handle(handlerInput, error) {
		console.log(`Error handled: ${error.message}`);

		return handlerInput.responseBuilder
			.getResponse();
	}
};


exports.handler = Alexa.SkillBuilders.custom()
	.addRequestHandlers(
		LaunchRequestHandler,
		StartSoundHandler,
		ExitHandler,
                SessionEndedRequestHandler,
		PausePlaybackHandler,
		AudioPlayerEventHandler)
	.addErrorHandlers(ErrorHandler)
	.lambda();

How to Enable Preflight CORS in PHP for Angular HTTP requests

When testing Ionic or Angular app you might need to set CORS policy to access a service on a different domain. One way to do this in PHP for testing is to send OK responses for all OPTIONS requests. (If you are testing POST and GET requests)

In your php file set:

// change to your app origin
header('Access-Control-Allow-Origin: http://localhost:8100');
header ("Access-Control-Expose-Headers: Content-Length, X-JSON");
header ("Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS");
header ("Access-Control-Allow-Headers: Content-Type, Authorization, Accept, Accept-Language, X-Authorization");
header('Access-Control-Max-Age: 86400');

if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
    // The request is using the POST method
    header("HTTP/1.1 200 OK");
    return;

}

Don’t ship this test code, this is just for your internal testing of http requests.

Facebook Deleted Mark Zuckerberg Early Posts

Business Insider:

Old Facebook posts by Mark Zuckerberg have disappeared — obscuring details about core moments in Facebook’s history.

On multiple occassions, years-old public posts made by the 34-year-old billionaire chief executive that were previously public and reported on by news outlets at the time have since vanished, Business Insider has found. That includes all of the posts he made during 2007 and 2008.

Reached for comment, a Facebook spokesperson said the posts were “mistakenly deleted” due to “technical errors.”

Right. Mistake.

Categories NewsCategories