[{"data":1,"prerenderedAt":371},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":203,"content-\u002F2020\u002F03\u002F02\u002Frevisiting-the-sbanken-api-with-swiftui\u002F":204},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},191,{"id":205,"title":206,"body":207,"category":27,"date":352,"description":353,"embedImage":354,"extension":355,"image":354,"intro":225,"meta":356,"navigation":357,"path":358,"seo":359,"series":360,"sitemap":361,"stem":362,"tags":363,"__hash__":370},"content\u002F2020\u002F03\u002F02\u002Frevisiting-the-sbanken-api-with-swiftui.md","Revisiting the S'banken API with SwiftUI",{"type":208,"value":209,"toc":346},"minimark",[210,220,223,226,229,234,247,260,263,274,282,284,288,291,302,305,308,311,337,339],[211,212,213,214,219],"p",{},"Back in September 2018 ",[215,216,218],"a",{"href":217},"\u002F2018\u002F09\u002F26\u002Fpocket-money-with-the-s-banken-api\u002F","I wrote about using the new S'banken API"," to create a pocket money app for iOS - since they didn't have one at the time.",[211,221,222],{},"The still don't - but - iOS development has moved on a bit since then - notably with the release last year of SwiftUI.",[211,224,225],{},"In this series - we will take a look at creating the app from scratch - but using SwiftUI and some helper libraries.",[227,228],"hr",{},[230,231,233],"h2",{"id":232},"recap","Recap",[211,235,236,237,246],{},"The ",[215,238,245],{"href":239,"rel":240,"target":244},"https:\u002F\u002Fsecure.sbanken.no\u002FPersonal\u002FApiBeta\u002FInfo\u002F",[241,242,243],"nofollow","noopener","noreferer","_blank","S'banken API"," provides several functions. In the previous application - we used:",[248,249,250,254,257],"ul",{},[251,252,253],"li",{},"Authorization",[251,255,256],{},"Get list of accounts",[251,258,259],{},"Get account details",[211,261,262],{},"To do this - we needed 3 values:",[248,264,265,268,271],{},[251,266,267],{},"The client ID (applikasjonsnøkkel)",[251,269,270],{},"The client secret (generated on the developer portal - usually valid for 3 months)",[251,272,273],{},"The ID number of the account owner (fødselsnummer - 11 digits)",[211,275,276,277,281],{},"The authorization uses ",[278,279,280],"em",{},"client credentials grant flow",".",[227,283],{},[230,285,287],{"id":286},"the-plan","The plan",[211,289,290],{},"Entering the new client secret every 90 days got old quite fast. The new app will be provided with 4 values:",[248,292,293,295,297,299],{},[251,294,267],{},[251,296,270],{},[251,298,273],{},[251,300,301],{},"The bank account ID",[211,303,304],{},"These will be provided via QR code (remember not to share the code) to simplify data entry",[211,306,307],{},"SwiftUI will be used instead of Swift+Storyboards. SwiftUI is not quite as feature complete as Swift+Storyboards yet - but it is fully usable.",[211,309,310],{},"We will make use of the new Swift Package Manager for dependencies. Initial libraries I expect to use are:",[248,312,313,321,329],{},[251,314,315,320],{},[215,316,319],{"href":317,"rel":318,"target":244},"https:\u002F\u002Fgithub.com\u002FAlamofire\u002FAlamofire.git",[241,242,243],"Alamofire"," - network calls (if S'banken adds their API library to Swift Package Manager instead of Carthage we'll revisit this)",[251,322,323,328],{},[215,324,327],{"href":325,"rel":326,"target":244},"https:\u002F\u002Fgithub.com\u002Ftwostraws\u002FCodeScanner.git",[241,242,243],"Code Scanner"," - wraps up the QR scanner in a nice swift UI component",[251,330,331,336],{},[215,332,335],{"href":333,"rel":334,"target":244},"https:\u002F\u002Fgithub.com\u002Ftimbersoftware\u002FSwiftUIRefresh.git",[241,242,243],"SwiftUI Refresh"," - implements pull to refresh for Swift UI",[227,338],{},[211,340,341],{},[215,342,345],{"href":343,"rel":344,"target":244},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Flommepenger-swiftui",[241,242,243],"GitHub Repository",{"title":347,"searchDepth":348,"depth":348,"links":349},"",2,[350,351],{"id":232,"depth":348,"text":233},{"id":286,"depth":348,"text":287},"2020-03-02 20:13 +0100","Back in September 2018 I wrote about using the new S'banken API to create a pocket money app for iOS - since they didn't have one at the time.",null,"md",{},true,"\u002F2020\u002F03\u002F02\u002Frevisiting-the-sbanken-api-with-swiftui",{"title":206,"description":353},"Revisiting the Sbanken API with SwiftUI",{"loc":358},"2020\u002F03\u002F02\u002Frevisiting-the-sbanken-api-with-swiftui",[364,365,366,367,368,369],"sbanken","open banking","ios","swift","swiftui","xcode","2wXasu_-rQ9HbM97ahJdvCdBGFPUCPWjTb9dHx5YYMM",1775293007091]